instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
Which competition in Budapest, Hungary gave a result of 8th?
CREATE TABLE table_name_1 ( competition VARCHAR, position VARCHAR, venue VARCHAR )
SELECT competition FROM table_name_1 WHERE position = "8th" AND venue = "budapest, hungary"
Below are sql tables 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 competition in Budapest, Hungary gave a result of 8th? ### Input: CREATE TABLE table_name_1 ( competition VARCHAR,...
What's Italy's time when the notes were SA/B?
CREATE TABLE table_name_96 ( time VARCHAR, notes VARCHAR, country VARCHAR )
SELECT time FROM table_name_96 WHERE notes = "sa/b" AND country = "italy"
Below are sql tables 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 Italy's time when the notes were SA/B? ### Input: CREATE TABLE table_name_96 ( time VARCHAR, notes VARCHAR, ...
show me the ground transportation to WESTCHESTER COUNTY
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE flight_stop ( flight_id in...
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city, ground_service WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'WESTCHESTER COUNTY' AND ground_service.airport_code = airport.airport_code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me the ground transportation to WESTCHESTER COUNTY ### Input: CREATE TABLE time_zone ( time_zone_code text, tim...
When did St Kilda play a home game?
CREATE TABLE table_10204 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Date" FROM table_10204 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: When did St Kilda play a home game? ### Input: CREATE TABLE table_10204 ( "Home team" text, "Home team score" text, ...
what is the first year listed ?
CREATE TABLE table_204_357 ( id number, "year" number, "div." text, "pos." text, "cup" text, "top scorer (league)" text, "score" number )
SELECT "year" FROM table_204_357 WHERE id = 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 first year listed ? ### Input: CREATE TABLE table_204_357 ( id number, "year" number, "div." text, ...
What is the population of the settlement with the cyrillic name of ?
CREATE TABLE table_2562572_44 ( population__2011_ INTEGER, cyrillic_name_other_names VARCHAR )
SELECT MAX(population__2011_) FROM table_2562572_44 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: What is the population of the settlement with the cyrillic name of ? ### Input: CREATE TABLE table_2562572_44 ( populati...
Show me 300 -level courses that are easy .
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semes...
SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND program_course.course_id = course.course_id AND program_course.workload < 3 ORDER BY program_course.workload
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me 300 -level courses that are easy . ### Input: CREATE TABLE offering_instructor ( offering_instructor_id int, ...
For those products with a price between 60 and 120, visualize a bar chart about the distribution of name and manufacturer , show Y in descending order.
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
SELECT Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Manufacturer 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 products with a price between 60 and 120, visualize a bar chart about the distribution of name and manufacturer , ...
how much did it cost for patient 55281 hospital stay on this hospital encounter?
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuo...
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55281 AND admissions.dischtime 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 much did it cost for patient 55281 hospital stay on this hospital encounter? ### Input: CREATE TABLE microbiologyevents ...
Who had high rebounds when the date was march 25?
CREATE TABLE table_27756314_10 ( high_rebounds VARCHAR, date VARCHAR )
SELECT high_rebounds FROM table_27756314_10 WHERE date = "March 25"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who had high rebounds when the date was march 25? ### Input: CREATE TABLE table_27756314_10 ( high_rebounds VARCHAR, ...
Which team was the away team when home team was essendon?
CREATE TABLE table_29090919_1 ( away_team VARCHAR, home_team VARCHAR )
SELECT away_team FROM table_29090919_1 WHERE home_team = "Essendon"
Below are sql tables 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 team was the away team when home team was essendon? ### Input: CREATE TABLE table_29090919_1 ( away_team VARCHAR, ...
What's the bus width (in bit) of the model whose core is 650 MHz?
CREATE TABLE table_22857 ( "Model" text, "Year" text, "Code name" text, "Fab ( nm )" real, "Bus interface" text, "Transistor count (Millions)" real, "Memory max ( MiB )" text, "Core ( MHz )" real, "Memory ( MHz )" text, "Type" text, "Bus Width ( Bit )" real, "DirectX" tex...
SELECT COUNT("Bus Width ( Bit )") FROM table_22857 WHERE "Core ( MHz )" = '650'
Below are sql tables 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 bus width (in bit) of the model whose core is 650 MHz? ### Input: CREATE TABLE table_22857 ( "Model" text, ...
How many stadiums does each country have Show bar chart, could you rank X from high to low order please?
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) 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 swimme...
SELECT Country, COUNT(*) FROM stadium GROUP BY Country ORDER BY Country DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many stadiums does each country have Show bar chart, could you rank X from high to low order please? ### Input: CREATE T...
What was the date of a week larger than 16?
CREATE TABLE table_name_55 ( date VARCHAR, week INTEGER )
SELECT date FROM table_name_55 WHERE week > 16
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the date of a week larger than 16? ### Input: CREATE TABLE table_name_55 ( date VARCHAR, week INTEGER ) ###...
i'd like to know the earliest flight from BOSTON to SAN FRANCISCO
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, ...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FR...
Below are sql tables 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'd like to know the earliest flight from BOSTON to SAN FRANCISCO ### Input: CREATE TABLE airline ( airline_code varchar...
Return all the committees that have delegates from Democratic party, and count them by a bar chart, and could you show y axis in descending order please?
CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, ...
SELECT Committee, COUNT(Committee) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Democratic" GROUP BY Committee ORDER BY COUNT(Committee) 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 all the committees that have delegates from Democratic party, and count them by a bar chart, and could you show y axi...
in 2103, what are the four most frequent medications prescribed to stroke - ischemic stroke male patients of 20s after they have been diagnosed with stroke - ischemic stroke within 2 months?
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ...
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 = 'stroke - ischemic stroke' AND STRFTIME('%y', diagn...
Below are sql tables 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 2103, what are the four most frequent medications prescribed to stroke - ischemic stroke male patients of 20s after they ...
how many patients died in or before year 2180 had pituitary bleed as the primary disease?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PITUITARY BLEED" AND demographic.dod_year <= "2180.0"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients died in or before year 2180 had pituitary bleed as the primary disease? ### Input: CREATE TABLE demographi...
When has a Week of 8?
CREATE TABLE table_name_73 ( date VARCHAR, week VARCHAR )
SELECT date FROM table_name_73 WHERE week = 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: When has a Week of 8? ### Input: CREATE TABLE table_name_73 ( date VARCHAR, week VARCHAR ) ### Response: SELECT date...
What was the attendance when the Cincinnati Bengals were the opponents?
CREATE TABLE table_76804 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
SELECT "Attendance" FROM table_76804 WHERE "Opponent" = 'cincinnati bengals'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the attendance when the Cincinnati Bengals were the opponents? ### Input: CREATE TABLE table_76804 ( "Week" rea...
What number in the series are the episodes with production code 5016/5017?
CREATE TABLE table_21747 ( "No. in series" text, "No. in season" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text )
SELECT "No. in series" FROM table_21747 WHERE "Production code" = '5016/5017'
Below are sql tables 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 in the series are the episodes with production code 5016/5017? ### Input: CREATE TABLE table_21747 ( "No. in...
What is the average Gold, when Nation is Yugoslavia, and when Silver is greater than 0?
CREATE TABLE table_49687 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT AVG("Gold") FROM table_49687 WHERE "Nation" = 'yugoslavia' 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 average Gold, when Nation is Yugoslavia, and when Silver is greater than 0? ### Input: CREATE TABLE table_49687 ...
What is the sum of draws with 274-357 goals?
CREATE TABLE table_53853 ( "Rank" real, "Club 1" text, "Seasons" real, "Spells" real, "Played 2" real, "Drawn" real, "Lost" real, "Goals" text, "Points 3" text )
SELECT SUM("Drawn") FROM table_53853 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_53853 ( "Rank" real, "Club 1" text, "...
A bar chart for finding the number of the country of the airlines whose name starts with 'Orbit', and sort country in desc order.
CREATE TABLE routes ( rid integer, dst_apid integer, dst_ap varchar(4), src_apid bigint, src_ap varchar(4), alid bigint, airline varchar(4), codeshare text ) CREATE TABLE airlines ( alid integer, name text, iata varchar(2), icao varchar(3), callsign text, country...
SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country ORDER BY country DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for finding the number of the country of the airlines whose name starts with 'Orbit', and sort country in desc o...
Give me a histogram for what are all the employee ids and the names of the countries in which they work?, order by the y axis from high to low.
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 countries ( COUNTRY_ID...
SELECT COUNTRY_NAME, SUM(EMPLOYEE_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID JOIN locations AS T3 ON T2.LOCATION_ID = T3.LOCATION_ID JOIN countries AS T4 ON T3.COUNTRY_ID = T4.COUNTRY_ID GROUP BY COUNTRY_NAME ORDER BY SUM(EMPLOYEE_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: Give me a histogram for what are all the employee ids and the names of the countries in which they work?, order by the y axi...
Where is the location of the coimbatore medical college?
CREATE TABLE table_name_42 ( location VARCHAR, college_name VARCHAR )
SELECT location FROM table_name_42 WHERE college_name = "coimbatore medical college"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where is the location of the coimbatore medical college? ### Input: CREATE TABLE table_name_42 ( location VARCHAR, c...
Where did the away team score 13.14 (92)?
CREATE TABLE table_54545 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Venue" FROM table_54545 WHERE "Away team score" = '13.14 (92)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where did the away team score 13.14 (92)? ### Input: CREATE TABLE table_54545 ( "Home team" text, "Home team score" ...
was the the number of canadian players more or less than the number of other players ?
CREATE TABLE table_203_824 ( id number, "pick #" number, "player" text, "position" text, "nationality" text, "nhl team" text, "college/junior/club team" text )
SELECT (SELECT COUNT("player") FROM table_203_824 WHERE "nationality" = 'canada') > (SELECT COUNT("player") FROM table_203_824 WHERE "nationality" <> 'canada')
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: was the the number of canadian players more or less than the number of other players ? ### Input: CREATE TABLE table_203_824...
Show budget type codes and the number of documents in each budget type with a bar chart, list x-axis in descending order.
CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEG...
SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code ORDER BY Budget_Type_Code DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show budget type codes and the number of documents in each budget type with a bar chart, list x-axis in descending order. ##...
What are the first names and support rep ids for employees serving 10 or more customers?
CREATE TABLE invoiceline ( invoicelineid number, invoiceid number, trackid number, unitprice number, quantity number ) CREATE TABLE genre ( genreid number, name text ) CREATE TABLE playlist ( playlistid number, name text ) CREATE TABLE invoice ( invoiceid number, customeri...
SELECT T1.firstname, T1.supportrepid FROM customer AS T1 JOIN employee AS T2 ON T1.supportrepid = T2.employeeid GROUP BY T1.supportrepid HAVING COUNT(*) >= 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 are the first names and support rep ids for employees serving 10 or more customers? ### Input: CREATE TABLE invoiceline...
what are the three most frequently prescribed medications for patients who have had therapeutic antibacterials - fourth generation cephalosporin previously within the same hospital visit, during this year?
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicatio...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'therapeutic ant...
Below are sql tables 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 frequently prescribed medications for patients who have had therapeutic antibacterials - fourth gene...
A bar chart for what are the number of the payment dates for any payments that have an amount greater than 10 or were handled by a staff member with the first name Elsa?, rank in desc by the y-axis please.
CREATE TABLE staff ( staff_id TINYINT UNSIGNED, first_name VARCHAR(45), last_name VARCHAR(45), address_id SMALLINT UNSIGNED, picture BLOB, email VARCHAR(50), store_id TINYINT UNSIGNED, active BOOLEAN, username VARCHAR(16), password VARCHAR(40), last_update TIMESTAMP ) CREATE...
SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' ORDER BY COUNT(payment_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: A bar chart for what are the number of the payment dates for any payments that have an amount greater than 10 or were handle...
How many upper-level 1 -credit courses will there be in this Spring for ELI ?
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, ...
SELECT COUNT(DISTINCT course.course_id) FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.credits = 1 AND course.department = 'ELI' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spring...
Below are sql tables 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 upper-level 1 -credit courses will there be in this Spring for ELI ? ### Input: CREATE TABLE instructor ( instr...
Which artist has a draw greater than 15?
CREATE TABLE table_59987 ( "Draw" real, "Language" text, "Artist" text, "Song" text, "English translation" text, "Place" real, "Points" real )
SELECT "Artist" FROM table_59987 WHERE "Draw" > '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: Which artist has a draw greater than 15? ### Input: CREATE TABLE table_59987 ( "Draw" real, "Language" text, "Ar...
What was the Margin of Victory of winning score 68-67-69-65=269?
CREATE TABLE table_40988 ( "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text )
SELECT "Margin of victory" FROM table_40988 WHERE "Winning score" = '68-67-69-65=269'
Below are sql tables 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 Margin of Victory of winning score 68-67-69-65=269? ### Input: CREATE TABLE table_40988 ( "Date" text, ...
how much weight change does patient 19428 have last measured on the current hospital visit compared to the value first measured on the current hospital visit?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE outputevents ( row_id number, subject_id number, ...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19428 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM...
Below are sql tables 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 weight change does patient 19428 have last measured on the current hospital visit compared to the value first measu...
What was the score for United States when the player was Mike Reid and the To par was e?
CREATE TABLE table_name_30 ( score VARCHAR, player VARCHAR, country VARCHAR, to_par VARCHAR )
SELECT score FROM table_name_30 WHERE country = "united states" AND to_par = "e" AND player = "mike reid"
Below are sql tables 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 for United States when the player was Mike Reid and the To par was e? ### Input: CREATE TABLE table_name_...
For those records from the products and each product's manufacturer, give me the comparison about the sum of price over the headquarter , and group by attribute headquarter by a bar chart, sort by the bars in asc.
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, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER 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, give me the comparison about the sum of price over the ...
Which Perth has Gold Coast yes, Sydney yes, Melbourne yes, and Adelaide yes?
CREATE TABLE table_name_56 ( perth VARCHAR, adelaide VARCHAR, melbourne VARCHAR, gold_coast VARCHAR, sydney VARCHAR )
SELECT perth FROM table_name_56 WHERE gold_coast = "yes" AND sydney = "yes" AND melbourne = "yes" AND adelaide = "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 Perth has Gold Coast yes, Sydney yes, Melbourne yes, and Adelaide yes? ### Input: CREATE TABLE table_name_56 ( per...
how many times did they play an opponent in november ?
CREATE TABLE table_204_755 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number )
SELECT COUNT(*) FROM table_204_755 WHERE "date" = 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: how many times did they play an opponent in november ? ### Input: CREATE TABLE table_204_755 ( id number, "week" num...
when did patient 033-22108 have the vascular 3 flush amount (ml) intake on the current intensive care unit visit for the last time?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text,...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-22108') AND patient.unitdischargetime IS NULL) 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: when did patient 033-22108 have the vascular 3 flush amount (ml) intake on the current intensive care unit visit for the las...
How many professors whose office is located in DRE 102 are hired in each weekday? Return a bar chart.
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 STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1),...
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' GROUP BY EMP_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 professors whose office is located in DRE 102 are hired in each weekday? Return a bar chart. ### Input: CREATE TABL...
What is the highest 1987 value with a 1995 value less than 1995 and a 1999 less than 9?
CREATE TABLE table_name_48 ( Id VARCHAR )
SELECT MAX(1987) FROM table_name_48 WHERE 1995 < 1995 AND 1999 < 9
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest 1987 value with a 1995 value less than 1995 and a 1999 less than 9? ### Input: CREATE TABLE table_name_4...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about manager_id over the last_name , order bar from low to high order.
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0),...
SELECT LAST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_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 employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison a...
What score has fred couples as the player?
CREATE TABLE table_45819 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
SELECT "Score" FROM table_45819 WHERE "Player" = 'fred couples'
Below are sql tables 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 score has fred couples as the player? ### Input: CREATE TABLE table_45819 ( "Place" text, "Player" text, "C...
count the number of patients younger than 20 years who suffer from neoplasm of uncertain behavior of other lymphatic and hematopoietic tissues/bone marrow transplant primary disease.
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "NEOPLASM OF UNCERTAIN BEHAVIOR OF OTHER LYMPHATIC AND HEMATOPOIETIC TISSUES\BONE MARROW TRANSPLANT" AND demographic.age < "20"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients younger than 20 years who suffer from neoplasm of uncertain behavior of other lymphatic and hem...
What is the amount of silver for rank 11 having less than 0 gold?
CREATE TABLE table_64874 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT MIN("Silver") FROM table_64874 WHERE "Rank" = '11' AND "Gold" < '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 amount of silver for rank 11 having less than 0 gold? ### Input: CREATE TABLE table_64874 ( "Rank" text, ...
What city has a team in IHSAA class 3a, and previous conference of lake?
CREATE TABLE table_name_83 ( city VARCHAR, previous_counference VARCHAR, ihsaa_class VARCHAR )
SELECT city FROM table_name_83 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_name_83 ( city VA...
i want to fly DENVER to PITTSBURGH
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, ...
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU...
Below are sql tables 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 fly DENVER to PITTSBURGH ### Input: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, airc...
how many female patients are with procedure icd9 code 8968?
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.gender = "F" AND procedures.icd9_code = "8968"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many female patients are with procedure icd9 code 8968? ### Input: CREATE TABLE diagnoses ( subject_id text, had...
what team played on august 25
CREATE TABLE table_6433 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text )
SELECT "Opponent" FROM table_6433 WHERE "Date" = 'august 25'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what team played on august 25 ### Input: CREATE TABLE table_6433 ( "Date" text, "Opponent" text, "Score" text, ...
Show me about the distribution of All_Road and Team_ID in a bar chart.
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Road, Team_ID FROM basketball_match
Below are sql tables 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 All_Road and Team_ID in a bar chart. ### Input: CREATE TABLE basketball_match ( Team_I...
What country is the show aired on TVNZ?
CREATE TABLE table_14523485_9 ( country VARCHAR, channel VARCHAR )
SELECT country FROM table_14523485_9 WHERE channel = "TVNZ"
Below are sql tables 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 country is the show aired on TVNZ? ### Input: CREATE TABLE table_14523485_9 ( country VARCHAR, channel VARCHAR ...
What is the province where the soccer statium is terrain #2 of complexe sportif claude-robillard?
CREATE TABLE table_29454 ( "University" text, "Varsity Name" text, "City" text, "Province" text, "Founded" real, "Soccer Stadium" text, "Stadium Capacity" real )
SELECT "Province" FROM table_29454 WHERE "Soccer Stadium" = 'terrain #2 of Complexe sportif Claude-Robillard'
Below are sql tables 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 province where the soccer statium is terrain #2 of complexe sportif claude-robillard? ### Input: CREATE TABLE ta...
what was the first value of sodium was for patient 23070 since 08/2103.
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id nu...
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23070) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'sodium') AND STRFTIME('%y-%m', labevents.charttime) >= '2103-08' ORDER BY labeve...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the first value of sodium was for patient 23070 since 08/2103. ### Input: CREATE TABLE d_icd_procedures ( row_i...
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of founder and the average of revenue , and group by attribute founder, I want to order the average of revenue in desc 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 Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Revenue) 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, draw a bar chart about the distribution of founder and ...
What was Week 11 when Week 10 had Nebraska (7-1)?
CREATE TABLE table_58978 ( "Week 9 Oct 23" text, "Week 10 Oct 30" text, "Week 11 Nov 6" text, "Week 12 Nov 13" text, "Week 13 Nov 20" text, "Week 14 Nov 27" text, "Week 15 (Final) Dec 3" text )
SELECT "Week 11 Nov 6" FROM table_58978 WHERE "Week 10 Oct 30" = 'nebraska (7-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 Week 11 when Week 10 had Nebraska (7-1)? ### Input: CREATE TABLE table_58978 ( "Week 9 Oct 23" text, "Week ...
On August 22, how many people came to the game?
CREATE TABLE table_67152 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
SELECT "Attendance" FROM table_67152 WHERE "Date" = 'august 22'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On August 22, how many people came to the game? ### Input: CREATE TABLE table_67152 ( "Date" text, "Opponent" text, ...
A bar chart shows the distribution of All_Neutral and ACC_Percent , and rank by the y-axis from low to high please.
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 All_Neutral, ACC_Percent FROM basketball_match ORDER BY ACC_Percent
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart shows the distribution of All_Neutral and ACC_Percent , and rank by the y-axis from low to high please. ### Inpu...
Which Week has an Attendance of 72,855?
CREATE TABLE table_name_47 ( week INTEGER, attendance VARCHAR )
SELECT MAX(week) FROM table_name_47 WHERE attendance = "72,855"
Below are sql tables 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 has an Attendance of 72,855? ### Input: CREATE TABLE table_name_47 ( week INTEGER, attendance VARCHAR ) #...
Find the names and number of works of all artists who have at least one English songs.
CREATE TABLE song ( artist_name VARCHAR, languages VARCHAR ) CREATE TABLE artist ( artist_name VARCHAR )
SELECT T1.artist_name, COUNT(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = "english" GROUP BY T2.artist_name HAVING COUNT(*) >= 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: Find the names and number of works of all artists who have at least one English songs. ### Input: CREATE TABLE song ( ar...
count the number of patients who have received a destruct peritoneal tiss procedure within the same month after having received a insert endotracheal tube in 2101.
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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) ...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'insert endo...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients who have received a destruct peritoneal tiss procedure within the same month after having recei...
What is the sum of swimsuit with an evening gown of 9.773 and average larger than 9.674?
CREATE TABLE table_54691 ( "State" text, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real )
SELECT SUM("Swimsuit") FROM table_54691 WHERE "Evening Gown" = '9.773' AND "Average" > '9.674'
Below are sql tables 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 swimsuit with an evening gown of 9.773 and average larger than 9.674? ### Input: CREATE TABLE table_54691...
For the top 3 days with the largest max gust speeds, please bin the date into the day of the week and then sum the mean temperature for a bar chart.
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, SUM(mean_temperature_f) FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 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: For the top 3 days with the largest max gust speeds, please bin the date into the day of the week and then sum the mean temp...
what are patient 4092's differences in heart rate measured at 2104-07-02 11:00:00 compared to the value measured at 2104-07-02 05:00:00?
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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4092)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'he...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are patient 4092's differences in heart rate measured at 2104-07-02 11:00:00 compared to the value measured at 2104-07-...
What are the names of the aircraft that the least people are certified to fly?
CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number ) CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE aircraft ( aid number, name text, di...
SELECT T2.name FROM certificate AS T1 JOIN aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid 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: What are the names of the aircraft that the least people are certified to fly? ### Input: CREATE TABLE flight ( flno num...
provide me with the number of male patients who had diagnosis icd9 code 25002.
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.icd9_code = "25002"
Below are sql tables 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 me with the number of male patients who had diagnosis icd9 code 25002. ### Input: CREATE TABLE procedures ( subj...
What city is the hidden valley raceway in?
CREATE TABLE table_35845 ( "Event Circuit" text, "City / State" text, "Date" text, "Format" text, "Winner" text, "Team" text )
SELECT "City / State" FROM table_35845 WHERE "Event 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 city is the hidden valley raceway in? ### Input: CREATE TABLE table_35845 ( "Event Circuit" text, "City / State...
Bar chart of department_id from each first name, and show in ascending by the y-axis.
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 employees ( EMPLOYE...
SELECT FIRST_NAME, DEPARTMENT_ID FROM employees ORDER BY DEPARTMENT_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: Bar chart of department_id from each first name, and show in ascending by the y-axis. ### Input: CREATE TABLE departments ( ...
Which Average has Yards larger than 167, and a Team of at tb, and a Week larger than 7?
CREATE TABLE table_name_98 ( average INTEGER, week VARCHAR, yards VARCHAR, team VARCHAR )
SELECT MIN(average) FROM table_name_98 WHERE yards > 167 AND team = "at tb" AND week > 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: Which Average has Yards larger than 167, and a Team of at tb, and a Week larger than 7? ### Input: CREATE TABLE table_name_9...
Which transportation method is used the most often to get to tourist attractions?
CREATE TABLE royal_family ( royal_family_id number, royal_family_details text ) CREATE TABLE visits ( visit_id number, tourist_attraction_id number, tourist_id number, visit_date time, visit_details text ) CREATE TABLE locations ( location_id number, location_name text, address...
SELECT how_to_get_there FROM tourist_attractions GROUP BY how_to_get_there 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: Which transportation method is used the most often to get to tourist attractions? ### Input: CREATE TABLE royal_family ( ...
has ever been the sao2 of patient 22897 been ever less than 98.0 until 21 months ago?
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 COUNT(*) > 0 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 = 22897)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2' AND d_items...
Below are sql tables 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 ever been the sao2 of patient 22897 been ever less than 98.0 until 21 months ago? ### Input: CREATE TABLE patients ( ...
Who was the opponent when Devin Gardner was the player?
CREATE TABLE table_28313 ( "Rank" real, "Player" text, "Year" real, "Opponent" text, "Passing yards" real, "Rushing yards" real, "Total offense" real )
SELECT "Opponent" FROM table_28313 WHERE "Player" = 'Devin Gardner'
Below are sql tables 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 when Devin Gardner was the player? ### Input: CREATE TABLE table_28313 ( "Rank" real, "Player" ...
What is Score, when Competition is 'Friendly', and when Date is '30 April'?
CREATE TABLE table_name_46 ( score VARCHAR, competition VARCHAR, date VARCHAR )
SELECT score FROM table_name_46 WHERE competition = "friendly" AND date = "30 april"
Below are sql tables 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 Score, when Competition is 'Friendly', and when Date is '30 April'? ### Input: CREATE TABLE table_name_46 ( scor...
Show me a scatter plot for the relationship between average and minimum age of captains in each class.
CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text )
SELECT AVG(age), MIN(age) FROM captain GROUP BY Class
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me a scatter plot for the relationship between average and minimum age of captains in each class. ### Input: CREATE TAB...
Show the names of products and the number of events they are in, sorted by the number of events in descending order by a bar chart.
CREATE TABLE Addresses ( Address_ID INTEGER, address_details VARCHAR(255) ) CREATE TABLE Assets_in_Events ( Asset_ID INTEGER, Event_ID INTEGER ) CREATE TABLE Parties_in_Events ( Party_ID INTEGER, Event_ID INTEGER, Role_Code CHAR(15) ) CREATE TABLE Finances ( Finance_ID INTEGER, Ot...
SELECT Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name ORDER BY COUNT(*) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the names of products and the number of events they are in, sorted by the number of events in descending order by a bar...
More than one answer by the same user.
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId n...
SELECT question.Id AS "post_link", answer.OwnerUserId AS "user_link", COUNT(answer.Id) AS answers FROM Posts AS question JOIN Posts AS answer ON (answer.ParentId = question.Id) WHERE answer.OwnerUserId != 0 GROUP BY question.Id, answer.OwnerUserId HAVING COUNT(answer.Id) >= 2 ORDER BY answers 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: More than one answer by the same user. ### Input: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId ...
has patient 12797 received a diagnosis of congenital hydrocele?
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuo...
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'congenital hydrocele') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12797)
Below are sql tables 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 12797 received a diagnosis of congenital hydrocele? ### Input: CREATE TABLE microbiologyevents ( row_id numb...
give me the number of patients whose primary disease is hyperglycemia and year of birth is less than 2168?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPERGLYCEMIA" AND demographic.dob_year < "2168"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose primary disease is hyperglycemia and year of birth is less than 2168? ### Input: CREATE...
count the number of patients whose discharge location is short term hospital and procedure short title is attach pedicle graft nec.
CREATE TABLE diagnoses ( 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 ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND procedures.short_title = "Attach pedicle graft NEC"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose discharge location is short term hospital and procedure short title is attach pedicle gra...
A bar chart for returning the number of the countries of the mountains that have a height larger than 5000, list y axis in descending order.
CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int ) CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text )
SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 GROUP BY Country ORDER BY COUNT(Country) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for returning the number of the countries of the mountains that have a height larger than 5000, list y axis in d...
show me the five most common diagnostics since 2101?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, ...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) >= '2101' GROUP BY diagnosis.diagnosisname) 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: show me the five most common diagnostics since 2101? ### Input: CREATE TABLE intakeoutput ( intakeoutputid number, p...
what is the procedure, which patient 030-34260 underwent two times during their current hospital encounter?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the procedure, which patient 030-34260 underwent two times during their current hospital encounter? ### Input: CREAT...
give me the number of patients whose ethnicity is white and diagnoses long title is panic disorder without agoraphobia?
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.ethnicity = "WHITE" AND diagnoses.long_title = "Panic disorder without agoraphobia"
Below are sql tables 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 ethnicity is white and diagnoses long title is panic disorder without agoraphobia? ### ...
What are the years of film market estimation for the market of Japan, ordered by year descending?
CREATE TABLE market ( market_id number, country text, number_cities number ) CREATE TABLE film_market_estimation ( estimation_id number, low_estimate number, high_estimate number, film_id number, type text, market_id number, year number ) CREATE TABLE film ( film_id number,...
SELECT T1.year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.market_id WHERE T2.country = "Japan" ORDER BY T1.year DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the years of film market estimation for the market of Japan, ordered by year descending? ### Input: CREATE TABLE ma...
was the last game a win or a loss ?
CREATE TABLE table_204_795 ( id number, "date" text, "opponent" text, "score" text, "result" text, "location" text, "attendance" number )
SELECT "result" FROM table_204_795 ORDER BY "date" 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: was the last game a win or a loss ? ### Input: CREATE TABLE table_204_795 ( id number, "date" text, "opponent" t...
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 hire_date and the average of department_id bin hire_date by time, I want to rank by the total number in descending.
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,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 jobs ( JOB_ID varchar(10), JOB_...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(DEPARTMENT_ID) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ...
Regarding Marine Dynamics , what times will it be offered ?
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credi...
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Regarding Marine Dynamics , what times will it be offered ? ### Input: CREATE TABLE instructor ( instructor_id int, ...
Show the number of stations installed change over the installation date of in station table using a line chart, order by the x-axis from high to low.
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE weather ( date TEXT, ...
SELECT installation_date, COUNT(installation_date) FROM station GROUP BY installation_date ORDER BY installation_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: Show the number of stations installed change over the installation date of in station table using a line chart, order by the...
What college did the player come from whose position is DL?
CREATE TABLE table_25085059_3 ( college VARCHAR, position VARCHAR )
SELECT college FROM table_25085059_3 WHERE position = "DL"
Below are sql tables 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 college did the player come from whose position is DL? ### Input: CREATE TABLE table_25085059_3 ( college VARCHAR, ...
among patients who have been diagnosed with prim cardiomyopathy nec tell me the one year survival rate.
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_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: among patients who have been diagnosed with prim cardiomyopathy nec tell me the one year survival rate. ### Input: CREATE TA...
how many teams won at least 85 games ?
CREATE TABLE table_204_905 ( id number, "team" text, "wins" number, "losses" number, "win %" number, "gb" number )
SELECT COUNT("team") FROM table_204_905 WHERE "wins" >= 85
Below are sql tables 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 teams won at least 85 games ? ### Input: CREATE TABLE table_204_905 ( id number, "team" text, "wins" nu...
show me BOSTON ground transportation
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_cod...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'BOSTON' AND ground_service.city_code = city.city_code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me BOSTON ground transportation ### Input: CREATE TABLE airline ( airline_code varchar, airline_name text, ...
How many gold have a silver of 1 and a bronze of 0?
CREATE TABLE table_name_12 ( gold INTEGER, silver VARCHAR, bronze VARCHAR )
SELECT SUM(gold) FROM table_name_12 WHERE silver = 1 AND bronze < 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many gold have a silver of 1 and a bronze of 0? ### Input: CREATE TABLE table_name_12 ( gold INTEGER, silver VAR...
Against what opponent did the game end 5-4?
CREATE TABLE table_29624 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text, "Points" real )
SELECT "Opponent" FROM table_29624 WHERE "Score" = '5-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: Against what opponent did the game end 5-4? ### Input: CREATE TABLE table_29624 ( "Game" real, "December" real, ...
What Team 2 has a second leg of 1-0?
CREATE TABLE table_71675 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
SELECT "Team 2" FROM table_71675 WHERE "2nd leg" = '1-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 Team 2 has a second leg of 1-0? ### Input: CREATE TABLE table_71675 ( "Team 1" text, "Agg." text, "Team 2" ...
which patients have order for nonsquamous epithelial cell lab test?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "NonSquamous Epithelial 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: which patients have order for nonsquamous epithelial cell lab test? ### Input: CREATE TABLE diagnoses ( subject_id text,...
since 113 days ago, list the monthly average sao2 of patient 031-11804.
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 AVG(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-11804')) AND NOT vitalperiodic.sao2 IS NULL AND DATET...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: since 113 days ago, list the monthly average sao2 of patient 031-11804. ### Input: CREATE TABLE patient ( uniquepid text...
give me the number of patients whose drug code is ns451000?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "NS451000"
Below are sql tables 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 ns451000? ### Input: CREATE TABLE procedures ( subject_id text, ha...
find out the number of female patients who have diagnoses icd9 code 53390.
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.icd9_code = "53390"
Below are sql tables 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 out the number of female patients who have diagnoses icd9 code 53390. ### Input: CREATE TABLE lab ( subject_id text...