instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
Visualize a scatter chart about the correlation between Credits and DNO .
CREATE TABLE Minor_in ( StuID INTEGER, DNO INTEGER ) CREATE TABLE Enrolled_in ( StuID INTEGER, CID VARCHAR(7), Grade VARCHAR(2) ) CREATE TABLE Course ( CID VARCHAR(7), CName VARCHAR(40), Credits INTEGER, Instructor INTEGER, Days VARCHAR(5), Hours VARCHAR(11), DNO INTEGE...
SELECT Credits, DNO FROM Course ORDER BY Credits
Below are sql tables 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 scatter chart about the correlation between Credits and DNO . ### Input: CREATE TABLE Minor_in ( StuID INTEG...
Find all information of all the products with a price between $60 and $120.
CREATE TABLE products ( price INTEGER )
SELECT * FROM products WHERE price BETWEEN 60 AND 120
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find all information of all the products with a price between $60 and $120. ### Input: CREATE TABLE products ( price INT...
what would be patient 003-54468's daily maximum weight since 2102?
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperio...
SELECT MAX(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-54468') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y', patient.unitadmittime) >= '2102' GROUP BY STRFTIME('%y-%m-%d', patient.unit...
Below are sql tables 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 would be patient 003-54468's daily maximum weight since 2102? ### Input: CREATE TABLE diagnosis ( diagnosisid numbe...
What is the largest number in attendance at H venue opposing Liverpool with a result of D?
CREATE TABLE table_name_40 ( attendance INTEGER, opponents VARCHAR, venue VARCHAR, result VARCHAR )
SELECT MAX(attendance) FROM table_name_40 WHERE venue = "h" AND result = "d" AND opponents = "liverpool"
Below are sql tables 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 largest number in attendance at H venue opposing Liverpool with a result of D? ### Input: CREATE TABLE table_nam...
What was North Melbourne's score as the home team?
CREATE TABLE table_name_30 ( home_team VARCHAR )
SELECT home_team AS score FROM table_name_30 WHERE home_team = "north melbourne"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was North Melbourne's score as the home team? ### Input: CREATE TABLE table_name_30 ( home_team VARCHAR ) ### Respo...
tell me the name of the organism found in the last blood culture microbiology test on patient 15968 in 08/2100?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, ...
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15968) AND microbiologyevents.spec_type_desc = 'blood culture' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y-%m', microbiologyevents.char...
Below are sql tables 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 name of the organism found in the last blood culture microbiology test on patient 15968 in 08/2100? ### Input: C...
What is the Class when Wessex Trains Pink is the Livery?
CREATE TABLE table_43400 ( "Number" real, "Class" real, "Name" text, "Livery" text, "Notes" text )
SELECT "Class" FROM table_43400 WHERE "Livery" = 'wessex trains pink'
Below are sql tables 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 Class when Wessex Trains Pink is the Livery? ### Input: CREATE TABLE table_43400 ( "Number" real, "Class...
Who's the opponent for June 13?
CREATE TABLE table_77732 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
SELECT "Opponent" FROM table_77732 WHERE "Date" = 'june 13'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who's the opponent for June 13? ### Input: CREATE TABLE table_77732 ( "Date" text, "Opponent" text, "Score" text...
For those records from the products and each product's manufacturer, return a bar chart about the distribution of headquarter and the average of code , and group by attribute headquarter, I want to show the average of code in descending order.
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 T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, return a bar chart about the distribution of headquarte...
What is guido bontempi's general classification when he has a stage of 6?
CREATE TABLE table_32904 ( "Stage" text, "Winner" text, "General classification" text, "Points classification" text, "Young rider classification" text, "Team classification" text )
SELECT "General classification" FROM table_32904 WHERE "Winner" = 'guido bontempi' AND "Stage" = '6'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is guido bontempi's general classification when he has a stage of 6? ### Input: CREATE TABLE table_32904 ( "Stage" ...
How many faculty members does each building have? List the result with the name of the building Visualize by bar chart, I want to order in descending by the y-axis.
CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Student ( StuID INTEGER, LName...
SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY COUNT(*) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many faculty members does each building have? List the result with the name of the building Visualize by bar chart, I wa...
who won the most total medals ?
CREATE TABLE table_204_785 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
SELECT "nation" FROM table_204_785 ORDER BY "total" DESC LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who won the most total medals ? ### Input: CREATE TABLE table_204_785 ( id number, "rank" number, "nation" text,...
What are the Ages of the Seashell Trust School with Ofsted Report?
CREATE TABLE table_name_50 ( ages VARCHAR, report VARCHAR, school VARCHAR )
SELECT ages FROM table_name_50 WHERE report = "ofsted" AND school = "seashell trust"
Below are sql tables 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 Ages of the Seashell Trust School with Ofsted Report? ### Input: CREATE TABLE table_name_50 ( ages VARCHAR,...
Return the names of countries that have players that play the Forward position, as well as players who play the Defender position.
CREATE TABLE country ( country_id number, country_name text, capital text, official_native_language text ) CREATE TABLE player ( player_id number, player text, years_played text, total_wl text, singles_wl text, doubles_wl text, team number ) CREATE TABLE team ( team_id ...
SELECT T1.country_name FROM country AS T1 JOIN match_season AS T2 ON T1.country_id = T2.country WHERE T2.position = "Forward" INTERSECT SELECT T1.country_name FROM country AS T1 JOIN match_season AS T2 ON T1.country_id = T2.country WHERE T2.position = "Defender"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return the names of countries that have players that play the Forward position, as well as players who play the Defender pos...
What was the release date of Rabbit Romeo?
CREATE TABLE table_name_8 ( release_date VARCHAR, title VARCHAR )
SELECT release_date FROM table_name_8 WHERE title = "rabbit romeo"
Below are sql tables 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 release date of Rabbit Romeo? ### Input: CREATE TABLE table_name_8 ( release_date VARCHAR, title VARCHA...
What year was Bob Clement first elected?
CREATE TABLE table_18166 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text )
SELECT MIN("First elected") FROM table_18166 WHERE "Incumbent" = 'Bob Clement'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year was Bob Clement first elected? ### Input: CREATE TABLE table_18166 ( "District" text, "Incumbent" text, ...
among pateints who had a hospital stay for more than 17 days, how many of them were discharged to snf?
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 WHERE demographic.discharge_location = "SNF" AND demographic.days_stay > "17"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: among pateints who had a hospital stay for more than 17 days, how many of them were discharged to snf? ### Input: CREATE TAB...
What was the record for May 26?
CREATE TABLE table_name_64 ( record VARCHAR, date VARCHAR )
SELECT record FROM table_name_64 WHERE date = "may 26"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the record for May 26? ### Input: CREATE TABLE table_name_64 ( record VARCHAR, date VARCHAR ) ### Response:...
Bar chart, group and count the decor of rooms that have a king bed.
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
SELECT decor, COUNT(decor) FROM Rooms WHERE bedType = 'King' GROUP BY decor ORDER BY basePrice
Below are sql tables 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, group and count the decor of rooms that have a king bed. ### Input: CREATE TABLE Rooms ( RoomId TEXT, roo...
when was the last time that patient 033-17325 was prescribed a medicine via intra-cathet route until 11/2105?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-17325')) AND medication.routeadmin = 'intra-cathet' AND ST...
Below are sql tables 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 last time that patient 033-17325 was prescribed a medicine via intra-cathet route until 11/2105? ### Input: CRE...
What alumni were in rw: cancun as their original season?
CREATE TABLE table_26419467_1 ( alumni VARCHAR, original_season VARCHAR )
SELECT alumni FROM table_26419467_1 WHERE original_season = "RW: Cancun"
Below are sql tables 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 alumni were in rw: cancun as their original season? ### Input: CREATE TABLE table_26419467_1 ( alumni VARCHAR, ...
what are the five most frequent specimen tests that patients had within 2 months after they had been diagnosed with abdom aortic aneurysm until 2100?
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 labevents ( row_id number, subject_id number, hadm_...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the five most frequent specimen tests that patients had within 2 months after they had been diagnosed with abdom ao...
how many intensive care unit visits were patient 010-3286 having since 1 year ago?
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )...
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-3286') AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-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 intensive care unit visits were patient 010-3286 having since 1 year ago? ### Input: CREATE TABLE allergy ( all...
What is the Result of Game 3?
CREATE TABLE table_name_16 ( result VARCHAR, game VARCHAR )
SELECT result FROM table_name_16 WHERE game = "game 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 is the Result of Game 3? ### Input: CREATE TABLE table_name_16 ( result VARCHAR, game VARCHAR ) ### Response: S...
Draw a scatter chart about the correlation between School_ID and All_Games_Percent , and group by attribute ACC_Regular_Season.
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 School_ID, All_Games_Percent FROM basketball_match GROUP BY ACC_Regular_Season
Below are sql tables 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 scatter chart about the correlation between School_ID and All_Games_Percent , and group by attribute ACC_Regular_Seas...
Which episodes had production code 217?
CREATE TABLE table_18424435_3 ( title VARCHAR, production_code VARCHAR )
SELECT title FROM table_18424435_3 WHERE production_code = 217
Below are sql tables 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 episodes had production code 217? ### Input: CREATE TABLE table_18424435_3 ( title VARCHAR, production_code VA...
What is the least total when there are more than 2 golds and fewer than 0 silver?
CREATE TABLE table_12956 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT MIN("Total") FROM table_12956 WHERE "Gold" > '2' AND "Silver" < '0'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the least total when there are more than 2 golds and fewer than 0 silver? ### Input: CREATE TABLE table_12956 ( ...
For those records from the products and each product's manufacturer, visualize a scatter chart about the correlation between manufacturer and revenue , and group by attribute name.
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.Manufacturer, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP 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: For those records from the products and each product's manufacturer, visualize a scatter chart about the correlation between...
What city has a team in IHSAA class 3a, and previous conference of lake?
CREATE TABLE table_66185 ( "School" text, "City" text, "Team Name" text, "Enrollment 08-09" real, "IHSAA Class" text, "County" text, "Year Joined" text, "Previous Counference" text )
SELECT "City" FROM table_66185 WHERE "Previous Counference" = 'lake' AND "IHSAA Class" = '3a'
Below are sql tables 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 city has a team in IHSAA class 3a, and previous conference of lake? ### Input: CREATE TABLE table_66185 ( "School" ...
patient 59275 had been admitted to the hospital until 1 year ago?
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 59275 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-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: patient 59275 had been admitted to the hospital until 1 year ago? ### Input: CREATE TABLE admissions ( row_id number, ...
At what latitude can you find the diameter (km) of 500.0?
CREATE TABLE table_21076 ( "Name" text, "Latitude" text, "Longitude" text, "Diameter (km)" text, "Year named" real, "Name origin" text )
SELECT "Latitude" FROM table_21076 WHERE "Diameter (km)" = '500.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: At what latitude can you find the diameter (km) of 500.0? ### Input: CREATE TABLE table_21076 ( "Name" text, "Latitu...
Show the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000.
CREATE TABLE ref_transaction_types ( transaction_type_code text, transaction_type_description text ) CREATE TABLE sales ( sales_transaction_id number, sales_details text ) CREATE TABLE purchases ( purchase_transaction_id number, purchase_details text ) CREATE TABLE investors ( investor_id...
SELECT date_of_transaction FROM transactions WHERE share_count > 100 OR amount_of_transaction > 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: Show the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000. ### Input: CREATE TA...
what is the least laps when the driver is rolf stommelen and the grid is more than 18?
CREATE TABLE table_name_99 ( laps INTEGER, driver VARCHAR, grid VARCHAR )
SELECT MIN(laps) FROM table_name_99 WHERE driver = "rolf stommelen" AND grid > 18
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the least laps when the driver is rolf stommelen and the grid is more than 18? ### Input: CREATE TABLE table_name_99...
Tell me the college/junior club team for pick of 16
CREATE TABLE table_4417 ( "Pick" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
SELECT "College/junior/club team" FROM table_4417 WHERE "Pick" = '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: Tell me the college/junior club team for pick of 16 ### Input: CREATE TABLE table_4417 ( "Pick" text, "Player" text,...
How much gold does the tank have that has 3 silver and more than 3 bronze?
CREATE TABLE table_name_19 ( gold VARCHAR, silver VARCHAR, bronze VARCHAR )
SELECT COUNT(gold) FROM table_name_19 WHERE silver = 3 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: How much gold does the tank have that has 3 silver and more than 3 bronze? ### Input: CREATE TABLE table_name_19 ( gold ...
When will the next Utilization of Nursing Advanced Practice class take place ?
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, t...
SELECT DISTINCT semester.semester, semester.year FROM semester INNER JOIN course_offering ON semester.semester_id = course_offering.semester INNER JOIN course ON course.course_id = course_offering.course_id WHERE course.name LIKE '%Utilization of Nursing Advanced Practice%' AND semester.semester_id > (SELECT SEMESTERal...
Below are sql tables 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 will the next Utilization of Nursing Advanced Practice class take place ? ### Input: CREATE TABLE offering_instructor (...
What's the city/state of Hidden Valley Raceway?
CREATE TABLE table_62738 ( "Race Title" text, "Circuit" text, "City / State" text, "Date" text, "Winner" text )
SELECT "City / State" FROM table_62738 WHERE "Circuit" = 'hidden valley raceway'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the city/state of Hidden Valley Raceway? ### Input: CREATE TABLE table_62738 ( "Race Title" text, "Circuit" t...
how many medications were prescribed to patient 007-4322 since 4 years ago?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-4322')) AND DATETIME(medication.drugstarttime) >= 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: how many medications were prescribed to patient 007-4322 since 4 years ago? ### Input: CREATE TABLE treatment ( treatmen...
had patient 013-28507 had output amt-blake drain a output since 1812 days ago.
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-28507')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: had patient 013-28507 had output amt-blake drain a output since 1812 days ago. ### Input: CREATE TABLE cost ( costid num...
I want to know the proportion of the total number for each nominee.
CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int )
SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee
Below are sql tables 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 want to know the proportion of the total number for each nominee. ### Input: CREATE TABLE musical ( Musical_ID int, ...
Please show the most common publication date.
CREATE TABLE publication ( Publication_Date VARCHAR )
SELECT Publication_Date FROM publication GROUP BY Publication_Date 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: Please show the most common publication date. ### Input: CREATE TABLE publication ( Publication_Date VARCHAR ) ### Respo...
What courses are taught by Prof. Sarah Miller ?
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program ( program_id int, name varchar...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Sarah Miller%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What courses are taught by Prof. Sarah Miller ? ### Input: CREATE TABLE jobs ( job_id int, job_title varchar, de...
For those employees who did not have any job in the past, draw a scatter chart about the correlation between manager_id and department_id .
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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 T...
SELECT MANAGER_ID, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who did not have any job in the past, draw a scatter chart about the correlation between manager_id and ...
How many patients who had other percutaneous procedures on biliary tract died in or before the year 2148?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2148.0" AND procedures.long_title = "Other percutaneous procedures on biliary tract"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many patients who had other percutaneous procedures on biliary tract died in or before the year 2148? ### Input: CREATE ...
show afternoon flights from HOUSTON to DALLAS
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE fare_basis ( fare_basis_code ...
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 = 'HOUSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLA...
Below are sql tables 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 afternoon flights from HOUSTON to DALLAS ### Input: CREATE TABLE airline ( airline_code varchar, airline_name t...
What is the average number of goals for games played that total more than 8?
CREATE TABLE table_13485 ( "Team" text, "Games Played" real, "Wins" real, "Losses" real, "Ties" real, "Goals For" real, "Goals Against" real )
SELECT AVG("Goals For") FROM table_13485 WHERE "Games Played" > '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: What is the average number of goals for games played that total more than 8? ### Input: CREATE TABLE table_13485 ( "Team...
Top users from Helsinki, Finland.
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%helsinkiw%' OR UPPER(Location) LIKE '%HELSINKI%' OR Location LIKE '%Helsinki%' AND Reputation >= 1000 ORDER BY Reputation 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: Top users from Helsinki, Finland. ### Input: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId numbe...
What is the tournament with a 2006 value of A and a 2011 value of 1r?
CREATE TABLE table_name_13 ( tournament VARCHAR )
SELECT tournament FROM table_name_13 WHERE 2006 = "a" AND 2011 = "1r"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the tournament with a 2006 value of A and a 2011 value of 1r? ### Input: CREATE TABLE table_name_13 ( tournament...
How many students taking a course who received an A or C? Group by students' last name with a bar chart, and sort in ascending by the x axis please.
CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), E...
SELECT STU_LNAME, COUNT(STU_LNAME) FROM STUDENT AS T1 JOIN ENROLL AS T2 ON T1.STU_NUM = T2.STU_NUM WHERE T2.ENROLL_GRADE = 'C' OR T2.ENROLL_GRADE = 'A' GROUP BY STU_LNAME ORDER BY STU_LNAME
Below are sql tables 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 students taking a course who received an A or C? Group by students' last name with a bar chart, and sort in ascendi...
What is the sum of draws with 274-357 goals?
CREATE TABLE table_name_94 ( drawn INTEGER, goals VARCHAR )
SELECT SUM(drawn) FROM table_name_94 WHERE goals = "274-357"
Below are sql tables 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 draws with 274-357 goals? ### Input: CREATE TABLE table_name_94 ( drawn INTEGER, goals VARCHAR ) ...
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, find job_id and the sum of employee_id , and group by attribute job_id, and visualize them by a bar chart, and could you show bar in descending order please?
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLO...
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ...
Show names for all employees who have certificate of Boeing 737-800.
CREATE TABLE Employee ( name VARCHAR, eid VARCHAR ) CREATE TABLE Aircraft ( aid VARCHAR, name VARCHAR ) CREATE TABLE Certificate ( eid VARCHAR, aid VARCHAR )
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800"
Below are sql tables 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 names for all employees who have certificate of Boeing 737-800. ### Input: CREATE TABLE Employee ( name VARCHAR, ...
what is the number of patients whose days of hospital stay is greater than 23 and procedure icd9 code is 3606?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "23" AND procedures.icd9_code = "3606"
Below are sql tables 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 23 and procedure icd9 code is 3606? ### Input: CR...
Draw a bar chart about the distribution of meter_200 and the sum of ID , and group by attribute meter_200, rank in descending by the y axis.
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_40...
SELECT meter_200, SUM(ID) FROM swimmer GROUP BY meter_200 ORDER BY SUM(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: Draw a bar chart about the distribution of meter_200 and the sum of ID , and group by attribute meter_200, rank in descendin...
Name the film titled for marcel camus category:articles with hcards
CREATE TABLE table_18987377_1 ( film_title_used_in_nomination VARCHAR, director VARCHAR )
SELECT film_title_used_in_nomination FROM table_18987377_1 WHERE director = "Marcel Camus Category:Articles with hCards"
Below are sql tables 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 film titled for marcel camus category:articles with hcards ### Input: CREATE TABLE table_18987377_1 ( film_titl...
give the number of patients whose admission type is elective and procedure short title is incision of aorta.
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.short_title = "Incision of aorta"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give the number of patients whose admission type is elective and procedure short title is incision of aorta. ### Input: CREA...
show me the flights from SAN DIEGO to WASHINGTON
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE T...
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 = 'SAN DIEGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASH...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me the flights from SAN DIEGO to WASHINGTON ### Input: CREATE TABLE class_of_service ( booking_class varchar, r...
is patient 25696's urea nitrogen last measured on the last hospital visit greater than second to last measured on the last hospital visit?
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25696 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.l...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: is patient 25696's urea nitrogen last measured on the last hospital visit greater than second to last measured on the last h...
What was the home team score for the Richmond away team?
CREATE TABLE table_74607 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Home team score" FROM table_74607 WHERE "Away team" = 'richmond'
Below are sql tables 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 home team score for the Richmond away team? ### Input: CREATE TABLE table_74607 ( "Home team" text, "Ho...
A bar chart about what is the project id and detail for the project with at least two documents?
CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_...
SELECT T1.Project_Details, T1.Project_ID FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_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: A bar chart about what is the project id and detail for the project with at least two documents? ### Input: CREATE TABLE Doc...
Questions with highest number of bounties.
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 COUNT(v.BountyAmount), p.Id AS "post_link", p.ViewCount FROM Posts AS p JOIN Votes AS v ON v.PostId = p.Id WHERE v.VoteTypeId = 8 GROUP BY p.Id, p.ViewCount ORDER BY COUNT(v.BountyAmount) DESC LIMIT 500
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Questions with highest number of bounties. ### Input: CREATE TABLE Users ( Id number, Reputation number, Creatio...
Who is the cyber girl in week 3 when Demi Jessica was the cyber girl in week 1?
CREATE TABLE table_name_33 ( week_3 VARCHAR, week_1 VARCHAR )
SELECT week_3 FROM table_name_33 WHERE week_1 = "demi jessica"
Below are sql tables 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 cyber girl in week 3 when Demi Jessica was the cyber girl in week 1? ### Input: CREATE TABLE table_name_33 ( ...
Find the first name and gpa of the students whose gpa is lower than the average gpa of all students.
CREATE TABLE enroll ( class_code text, stu_num number, enroll_grade text ) CREATE TABLE class ( class_code text, crs_code text, class_section text, class_time text, class_room text, prof_num number ) CREATE TABLE professor ( emp_num number, dept_code text, prof_office t...
SELECT stu_fname, stu_gpa FROM student WHERE stu_gpa < (SELECT AVG(stu_gpa) FROM student)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the first name and gpa of the students whose gpa is lower than the average gpa of all students. ### Input: CREATE TABLE...
What was the away team against which the home team scored 10.14 (74)?
CREATE TABLE table_33230 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team" FROM table_33230 WHERE "Home team score" = '10.14 (74)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the away team against which the home team scored 10.14 (74)? ### Input: CREATE TABLE table_33230 ( "Home team" ...
Return a bar chart showing the number of documents for each document type description, I want to display x axis in desc order.
CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255)...
SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Description ORDER BY Document_Type_Description DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart showing the number of documents for each document type description, I want to display x axis in desc orde...
during the second leg , what number of matches ended in a draw ?
CREATE TABLE table_204_475 ( id number, "home team" text, "score" text, "away team" text, "date" text, "agg" text )
SELECT COUNT(*) FROM table_204_475 WHERE "score" = "score"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: during the second leg , what number of matches ended in a draw ? ### Input: CREATE TABLE table_204_475 ( id number, ...
what were the five most frequent drugs prescribed for patients who were also prescribed with benicar at the same time since 4 years ago?
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number,...
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 = 'benicar' AND DATETIME(prescriptions.startdate) >= DATETIME(CURREN...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the five most frequent drugs prescribed for patients who were also prescribed with benicar at the same time since ...
calculate the total number of unmarried male patients.
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.marital_status = "SINGLE" AND demographic.gender = "M"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the total number of unmarried male patients. ### Input: CREATE TABLE lab ( subject_id text, hadm_id text, ...
How many patients do each physician take care of? List their names and number of patients they take care of Show bar chart, and list by the y-axis in desc.
CREATE TABLE Prescribes ( Physician INTEGER, Patient INTEGER, Medication INTEGER, Date DATETIME, Appointment INTEGER, Dose VARCHAR(30) ) CREATE TABLE Trained_In ( Physician INTEGER, Treatment INTEGER, CertificationDate DATETIME, CertificationExpires DATETIME ) CREATE TABLE Unde...
SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID 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: How many patients do each physician take care of? List their names and number of patients they take care of Show bar chart, ...
among the patients of age 60 or above in 2104, what were the top five most frequent diagnoses?
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: among the patients of age 60 or above in 2104, what were the top five most frequent diagnoses? ### Input: CREATE TABLE patie...
give me the number of patients whose admission type is emergency and diagnoses icd9 code is 1550?
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.admission_type = "EMERGENCY" AND diagnoses.icd9_code = "1550"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose admission type is emergency and diagnoses icd9 code is 1550? ### Input: CREATE TABLE de...
What is the Fall and Winter schedule for upper-level electives ?
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, ...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (semester.semester = ...
Below are sql tables 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 Fall and Winter schedule for upper-level electives ? ### Input: CREATE TABLE area ( course_id int, area ...
give me the number of patients whose drug code is ergo400t?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "ERGO400T"
Below are sql tables 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 drug code is ergo400t? ### Input: CREATE TABLE diagnoses ( subject_id text, had...
Count the number of bank branches.
CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number ) CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, ...
SELECT COUNT(*) FROM bank
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Count the number of bank branches. ### Input: CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, ...
out of total number of patients who had a hospital stay for more than 10 days, how many of them had icd9 code v3101?
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.days_stay > "10" AND diagnoses.icd9_code = "V3101"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: out of total number of patients who had a hospital stay for more than 10 days, how many of them had icd9 code v3101? ### Inp...
calculate the number of patients who were admitted to the hospital until 2 years ago.
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-2 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: calculate the number of patients who were admitted to the hospital until 2 years ago. ### Input: CREATE TABLE patient ( ...
how many days have it been since patient 65582 was admitted in the icu?
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id numbe...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65582) AND icustays.outtime IS NULL
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many days have it been since patient 65582 was admitted in the icu? ### Input: CREATE TABLE microbiologyevents ( row...
In the tie where Southampton was the away team, who was the home team?
CREATE TABLE table_79188 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
SELECT "Home team" FROM table_79188 WHERE "Away team" = 'southampton'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In the tie where Southampton was the away team, who was the home team? ### Input: CREATE TABLE table_79188 ( "Tie no" te...
display all the information for all employees who have the letters D or S in their first name and also arrange the result in descending order by salary.
CREATE TABLE employees ( employee_id number, first_name text, last_name text, email text, phone_number text, hire_date time, job_id text, salary number, commission_pct number, manager_id number, department_id number ) CREATE TABLE departments ( department_id number, ...
SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: display all the information for all employees who have the letters D or S in their first name and also arrange the result in...
Draw a bar chart about the distribution of ACC_Road and the average of Team_ID , and group by attribute ACC_Road, and I want to sort in desc by the Y-axis.
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 ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(Team_ID) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart about the distribution of ACC_Road and the average of Team_ID , and group by attribute ACC_Road, and I want...
Which city has frequency under 106.5MHz and a callsign of w218ck?
CREATE TABLE table_name_31 ( city_of_license VARCHAR, frequency_mhz VARCHAR, call_sign VARCHAR )
SELECT city_of_license FROM table_name_31 WHERE frequency_mhz < 106.5 AND call_sign = "w218ck"
Below are sql tables 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 city has frequency under 106.5MHz and a callsign of w218ck? ### Input: CREATE TABLE table_name_31 ( city_of_licens...
Who is the player from the United States with a 75-70-68=211 score?
CREATE TABLE table_name_94 ( player VARCHAR, country VARCHAR, score VARCHAR )
SELECT player FROM table_name_94 WHERE country = "united states" AND score = 75 - 70 - 68 = 211
Below are sql tables 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 player from the United States with a 75-70-68=211 score? ### Input: CREATE TABLE table_name_94 ( player VARCH...
what was the score of the parallel bars with a floor exercise score more than 9.137, vault more than 9.5 and horizontal bar of 9.225?
CREATE TABLE table_name_87 ( parallel_bars INTEGER, vault VARCHAR, floor_exercise VARCHAR, horizontal_bar VARCHAR )
SELECT SUM(parallel_bars) FROM table_name_87 WHERE floor_exercise > 9.137 AND horizontal_bar = 9.225 AND vault > 9.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 was the score of the parallel bars with a floor exercise score more than 9.137, vault more than 9.5 and horizontal bar ...
For those records from the products and each product's manufacturer, show me about the distribution of headquarter and the amount of headquarter , and group by attribute headquarter in a bar chart.
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 Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
Below are sql tables 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, show me about the distribution of headquarter and the a...
Which Home team score has a Home team of geelong?
CREATE TABLE table_77976 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Home team score" FROM table_77976 WHERE "Home team" = 'geelong'
Below are sql tables 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 Home team score has a Home team of geelong? ### Input: CREATE TABLE table_77976 ( "Home team" text, "Home team...
What is the total number of bronze medals of the nation with 4 total medals and 1 silver?
CREATE TABLE table_7154 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT COUNT("Bronze") FROM table_7154 WHERE "Total" = '4' AND "Silver" = '1'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of bronze medals of the nation with 4 total medals and 1 silver? ### Input: CREATE TABLE table_7154...
show me the airlines that fly from TORONTO to BOSTON
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
SELECT DISTINCT airline.airline_code FROM airline, 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 = 'TORONTO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_n...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me the airlines that fly from TORONTO to BOSTON ### Input: CREATE TABLE aircraft ( aircraft_code varchar, aircr...
Which 2010 has a 2006 of w?
CREATE TABLE table_34431 ( "Tournament" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text, "Win %" real )
SELECT "2010" FROM table_34431 WHERE "2006" = 'w'
Below are sql tables 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 2010 has a 2006 of w? ### Input: CREATE TABLE table_34431 ( "Tournament" text, "2003" text, "2004" text, ...
does patient 18877 had an organism in his last bronchoalveolar lavage test during the first hospital visit?
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18877 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND microbiologyevents.spec_type_desc = 'bronchoalveolar lavage' AND NOT microbiology...
Below are sql tables 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 patient 18877 had an organism in his last bronchoalveolar lavage test during the first hospital visit? ### Input: CREAT...
What is the Apparent magnitude of a Declination (J2000) of 39 45 ?
CREATE TABLE table_name_67 ( apparent_magnitude INTEGER, declination___j2000__ VARCHAR )
SELECT MIN(apparent_magnitude) FROM table_name_67 WHERE declination___j2000__ = "°39′45″"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Apparent magnitude of a Declination (J2000) of 39 45 ? ### Input: CREATE TABLE table_name_67 ( apparent_magn...
What was the date of the game against Norway with a 1:1 result?
CREATE TABLE table_37776 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text )
SELECT "Date" FROM table_37776 WHERE "Opponent" = 'norway' AND "Results\u00b9" = '1:1'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the date of the game against Norway with a 1:1 result? ### Input: CREATE TABLE table_37776 ( "Date" text, "...
when was the last time patient 12938 received prescriptions in 02/last year?
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12938) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', prescriptions.startdate) = '02...
Below are sql tables 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 last time patient 12938 received prescriptions in 02/last year? ### Input: CREATE TABLE admissions ( row_id...
What is the name of the role that has a Title of Salud, Dinero y Amor and antagonist in the notes field?
CREATE TABLE table_71665 ( "Year" text, "Title" text, "Production Company" text, "Role" text, "Notes" text )
SELECT "Role" FROM table_71665 WHERE "Notes" = 'antagonist' AND "Title" = 'salud, dinero y amor'
Below are sql tables 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 role that has a Title of Salud, Dinero y Amor and antagonist in the notes field? ### Input: CREATE T...
how many patients aged below 54 years were admitted before the year 2162?
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 WHERE demographic.age < "54" AND demographic.admityear < "2162"
Below are sql tables 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 aged below 54 years were admitted before the year 2162? ### Input: CREATE TABLE prescriptions ( subjec...
A bar chart showing the first name of all the faculty members who participated in some activity, together with the number of activities they participated in, and show by the x-axis in desc.
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 Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Faculty ( FacID INTEGER, Lname...
SELECT Fname, COUNT(*) FROM Faculty AS T1 JOIN Faculty_Participates_in AS T2 ON T1.FacID = T2.FacID GROUP BY T1.FacID ORDER BY Fname 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: A bar chart showing the first name of all the faculty members who participated in some activity, together with the number of...
Name the loss for june 30
CREATE TABLE table_15488 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
SELECT "Loss" FROM table_15488 WHERE "Date" = 'june 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: Name the loss for june 30 ### Input: CREATE TABLE table_15488 ( "Date" text, "Opponent" text, "Score" text, ...
What's the average year for the Role of alvin seville simon seville david 'dave' seville, and a Title of the chipmunk adventure?
CREATE TABLE table_name_30 ( year INTEGER, role VARCHAR, title VARCHAR )
SELECT AVG(year) FROM table_name_30 WHERE role = "alvin seville simon seville david 'dave' seville" AND title = "the chipmunk adventure"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the average year for the Role of alvin seville simon seville david 'dave' seville, and a Title of the chipmunk advent...
Tell me the role of festival theatre
CREATE TABLE table_32108 ( "Year" real, "Play" text, "Role" text, "Theatre" text, "Location" text )
SELECT "Role" FROM table_32108 WHERE "Theatre" = 'festival theatre'
Below are sql tables 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 role of festival theatre ### Input: CREATE TABLE table_32108 ( "Year" real, "Play" text, "Role" text...
provide the number of patients whose lab test chart time is 2137-08-30 14:39:00.
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.charttime = "2137-08-30 14:39:00"
Below are sql tables 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 chart time is 2137-08-30 14:39:00. ### Input: CREATE TABLE demographic ( s...
What was the record for the Chargers on Week 10?
CREATE TABLE table_43476 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game Site" text, "Record" text, "Attendance" text )
SELECT "Record" FROM table_43476 WHERE "Week" = '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: What was the record for the Chargers on Week 10? ### Input: CREATE TABLE table_43476 ( "Week" real, "Date" text, ...