instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
HOW MANY CARS HAD A CAR # SMALLER THAN 7 AND STARTED ON 2010?
CREATE TABLE table_name_38 ( number_of_cars VARCHAR, car__number VARCHAR, year_started VARCHAR )
SELECT number_of_cars FROM table_name_38 WHERE car__number < 7 AND year_started = 2010
Below are sql tables 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 CARS HAD A CAR # SMALLER THAN 7 AND STARTED ON 2010? ### Input: CREATE TABLE table_name_38 ( number_of_cars VAR...
By whom is BIOLOGY 281 taught ?
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) 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, test...
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'BIOLOGY' AND course.number = 281 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offerin...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: By whom is BIOLOGY 281 taught ? ### Input: CREATE TABLE program ( program_id int, name varchar, college varchar,...
What is the lowest number of goals scored for the entry with goals conceded larger than 30, lost larger than 3, and fewer than 6 draws?
CREATE TABLE table_12412 ( "Place" real, "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" text )
SELECT MIN("Goals Scored") FROM table_12412 WHERE "Draw" < '6' AND "Lost" > '3' AND "Goals Conceded" > '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: What is the lowest number of goals scored for the entry with goals conceded larger than 30, lost larger than 3, and fewer th...
Draw a bar chart of date moved in versus how many date moved in, and sort in asc by the y axis.
CREATE TABLE Organizations ( organization_id INTEGER, parent_organization_id INTEGER, organization_details VARCHAR(255) ) CREATE TABLE Residents ( resident_id INTEGER, property_id INTEGER, date_moved_in DATETIME, date_moved_out DATETIME, other_details VARCHAR(255) ) CREATE TABLE Proper...
SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events GROUP BY date_moved_in ORDER BY COUNT(date_moved_in)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart of date moved in versus how many date moved in, and sort in asc by the y axis. ### Input: CREATE TABLE Orga...
Which 2011 has a 2009 of 15 2?
CREATE TABLE table_34430 ( "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 "2011" FROM table_34430 WHERE "2009" = '15–2'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which 2011 has a 2009 of 15 2? ### Input: CREATE TABLE table_34430 ( "Tournament" text, "2003" text, "2004" text...
what were the top three most common intakes this year?
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY intakeoutput.celllabel) AS ...
Below are sql tables 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 top three most common intakes this year? ### Input: CREATE TABLE patient ( uniquepid text, patientheal...
What boat was laid down on 25 april 1887?
CREATE TABLE table_name_26 ( name VARCHAR, laid_down VARCHAR )
SELECT name FROM table_name_26 WHERE laid_down = "25 april 1887"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What boat was laid down on 25 april 1887? ### Input: CREATE TABLE table_name_26 ( name VARCHAR, laid_down VARCHAR ) ...
Name the ground for essendon
CREATE TABLE table_72782 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text, "Time" text )
SELECT "Ground" FROM table_72782 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: Name the ground for essendon ### Input: CREATE TABLE table_72782 ( "Home team" text, "Home team score" text, "Aw...
find the number of patients diagnosed under icd9 code 36201.
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 diagnoses.icd9_code = "36201"
Below are sql tables 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 number of patients diagnosed under icd9 code 36201. ### Input: CREATE TABLE lab ( subject_id text, hadm_id ...
what is the percentage of male voters where the level of maturity is 123726
CREATE TABLE table_25042332_30 ( e_vap_ratio_total VARCHAR, men_of_voting_age VARCHAR )
SELECT e_vap_ratio_total FROM table_25042332_30 WHERE men_of_voting_age = 123726
Below are sql tables 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 percentage of male voters where the level of maturity is 123726 ### Input: CREATE TABLE table_25042332_30 ( ...
count the number of drugs until 3 years ago patient 62983 was prescribed.
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 62983) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 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: count the number of drugs until 3 years ago patient 62983 was prescribed. ### Input: CREATE TABLE prescriptions ( row_id...
What was the miles (km) for the race that had an average speed of 136.117 MPH?
CREATE TABLE table_2220432_1 ( miles__km_ VARCHAR, average_speed__mph_ VARCHAR )
SELECT miles__km_ FROM table_2220432_1 WHERE average_speed__mph_ = "136.117"
Below are sql tables 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 miles (km) for the race that had an average speed of 136.117 MPH? ### Input: CREATE TABLE table_2220432_1 ( ...
How many stores are headquarted in each city. Plot them as bar chart.
CREATE TABLE district ( District_ID int, District_name text, Headquartered_City text, City_Population real, City_Area real ) CREATE TABLE store ( Store_ID int, Store_Name text, Type text, Area_size real, Number_of_product_category real, Ranking int ) CREATE TABLE store_prod...
SELECT Headquartered_City, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.Store_ID = t2.Store_ID JOIN district AS t3 ON t2.District_ID = t3.District_ID GROUP BY t3.Headquartered_City
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many stores are headquarted in each city. Plot them as bar chart. ### Input: CREATE TABLE district ( District_ID int...
Tell me the role of festival theatre
CREATE TABLE table_name_35 ( role VARCHAR, theatre VARCHAR )
SELECT role FROM table_name_35 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_name_35 ( role VARCHAR, theatre VARCHAR ) ### Res...
What is the first name and GPA of every student that has a GPA lower than average?
CREATE TABLE course ( crs_code text, dept_code text, crs_description text, crs_credit number ) CREATE TABLE employee ( emp_num number, emp_lname text, emp_fname text, emp_initial text, emp_jobcode text, emp_hiredate time, emp_dob time ) CREATE TABLE professor ( emp_num ...
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: What is the first name and GPA of every student that has a GPA lower than average? ### Input: CREATE TABLE course ( crs_...
Where was the game played where North Melbourne was the away team?
CREATE TABLE table_name_40 ( venue VARCHAR, away_team VARCHAR )
SELECT venue FROM table_name_40 WHERE away_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: Where was the game played where North Melbourne was the away team? ### Input: CREATE TABLE table_name_40 ( venue VARCHAR...
what is the number of patients whose ethnicity is white - russian and days of hospital stay is greater than 69?
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.ethnicity = "WHITE - RUSSIAN" AND demographic.days_stay > "69"
Below are sql tables 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 ethnicity is white - russian and days of hospital stay is greater than 69? ### Input: C...
For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, order by the total number in asc.
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the sum of...
For those records from the products and each product's manufacturer, find headquarter and the sum of price , and group by attribute headquarter, and visualize them by a bar chart.
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
SELECT Headquarter, SUM(Price) 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, find headquarter and the sum of price , and group by at...
how many female patients are under 67 years of age?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.age < "67"
Below are sql tables 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 under 67 years of age? ### Input: CREATE TABLE lab ( subject_id text, hadm_id text, ...
What year is the event in athens, greece?
CREATE TABLE table_name_19 ( year INTEGER, venue VARCHAR )
SELECT MAX(year) FROM table_name_19 WHERE venue = "athens, greece"
Below are sql tables 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 is the event in athens, greece? ### Input: CREATE TABLE table_name_19 ( year INTEGER, venue VARCHAR ) ### ...
give me the number of patients whose admission year is less than 2194 and diagnoses short title is dysphagia nec?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2194" AND diagnoses.short_title = "Dysphagia NEC"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose admission year is less than 2194 and diagnoses short title is dysphagia nec? ### Input:...
Which average Points has a Lost higher than 20?
CREATE TABLE table_41937 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
SELECT AVG("Points") FROM table_41937 WHERE "Lost" > '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: Which average Points has a Lost higher than 20? ### Input: CREATE TABLE table_41937 ( "Position" real, "Team" text, ...
give me a restaurant on bethel island rd in bethel island ?
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'bethel island' AND location.street_name = 'bethel island rd' AND restaurant.id = location.restaurant_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: give me a restaurant on bethel island rd in bethel island ? ### Input: CREATE TABLE restaurant ( id int, name varcha...
A line chart shows the change of the sum of monthly_rental over date_address_to , and group by attribute other_details
CREATE TABLE Behavior_Incident ( incident_id INTEGER, incident_type_code VARCHAR(10), student_id INTEGER, date_incident_start DATETIME, date_incident_end DATETIME, incident_summary VARCHAR(255), recommendations VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Ref_Detention_Type (...
SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details, date_address_to ORDER BY monthly_rental 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 line chart shows the change of the sum of monthly_rental over date_address_to , and group by attribute other_details ### I...
i need to know what flights leave ATLANTA on sunday evening and arrive in BALTIMORE
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CRE...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 27 AND date_day.month_number = 8 AN...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: i need to know what flights leave ATLANTA on sunday evening and arrive in BALTIMORE ### Input: CREATE TABLE city ( city_...
count the numbers of patients who were diagnosed with acute respiratory distress and did not come back to the hospital within 2 months in 2105.
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory distress' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') AS t1) - (SELECT C...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the numbers of patients who were diagnosed with acute respiratory distress and did not come back to the hospital withi...
What are the times used by climbers who climbed mountains in the country of Uganda?
CREATE TABLE mountain ( mountain_id number, name text, height number, prominence number, range text, country text ) CREATE TABLE climber ( climber_id number, name text, country text, time text, points number, mountain_id number )
SELECT T1.time FROM climber AS T1 JOIN mountain AS T2 ON T1.mountain_id = T2.mountain_id WHERE T2.country = "Uganda"
Below are sql tables 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 times used by climbers who climbed mountains in the country of Uganda? ### Input: CREATE TABLE mountain ( m...
had patient 9833 undergone a phosphate test until 73 months ago?
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_nam...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'phosphate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9833) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-73 month')
Below are sql tables 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 9833 undergone a phosphate test until 73 months ago? ### Input: CREATE TABLE labevents ( row_id number, ...
Specify the minimum age of patients who stayed at hospital for 20 days and died before the year 2164
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.days_stay = "20" AND demographic.dod_year < "2164.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: Specify the minimum age of patients who stayed at hospital for 20 days and died before the year 2164 ### Input: CREATE TABLE...
For each record in schedule, show the number of films for each day in a bar chart, display by the y axis in ascending.
CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE schedule...
SELECT Date, COUNT(Date) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Date ORDER BY COUNT(Date)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For each record in schedule, show the number of films for each day in a bar chart, display by the y axis in ascending. ### I...
When was the most recent game that he partnered with nicklas kulti and they scored 3 6, 7 6, 6 4?
CREATE TABLE table_8449 ( "Outcome" text, "Date" real, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
SELECT MAX("Date") FROM table_8449 WHERE "Partner" = 'nicklas kulti' AND "Score" = '3–6, 7–6, 6–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: When was the most recent game that he partnered with nicklas kulti and they scored 3 6, 7 6, 6 4? ### Input: CREATE TABLE ta...
What prefix has Bromo as the group?
CREATE TABLE table_52663 ( "Chemical class" text, "Group" text, "Formula" text, "Prefix" text, "Suffix" text, "Example" text )
SELECT "Prefix" FROM table_52663 WHERE "Group" = 'bromo'
Below are sql tables 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 prefix has Bromo as the group? ### Input: CREATE TABLE table_52663 ( "Chemical class" text, "Group" text, "...
What Partner had a Score of 6 3, 2 6, 6 3?
CREATE TABLE table_name_31 ( partner VARCHAR, score VARCHAR )
SELECT partner FROM table_name_31 WHERE score = "6–3, 2–6, 6–3"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Partner had a Score of 6 3, 2 6, 6 3? ### Input: CREATE TABLE table_name_31 ( partner VARCHAR, score VARCHAR ) ...
How many different payment methods are there?
CREATE TABLE customers ( payment_method VARCHAR )
SELECT COUNT(DISTINCT payment_method) FROM customers
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many different payment methods are there? ### Input: CREATE TABLE customers ( payment_method VARCHAR ) ### Response:...
How many actors are there?
CREATE TABLE actor ( actor_id number, name text, musical_id number, character text, duration text, age number ) CREATE TABLE musical ( musical_id number, name text, year number, award text, category text, nominee text, result text )
SELECT COUNT(*) FROM actor
Below are sql tables 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 actors are there? ### Input: CREATE TABLE actor ( actor_id number, name text, musical_id number, ch...
Show the number of accounts in a bar chart that groups by other account details.
CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, date_account_opened DATETIME, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME ) CREATE TABLE Order_Items ( order_i...
SELECT other_account_details, COUNT(other_account_details) FROM Accounts GROUP BY other_account_details
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the number of accounts in a bar chart that groups by other account details. ### Input: CREATE TABLE Accounts ( acco...
On what date did Collingwood play at home?
CREATE TABLE table_name_20 ( date VARCHAR, home_team VARCHAR )
SELECT date FROM table_name_20 WHERE home_team = "collingwood"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On what date did Collingwood play at home? ### Input: CREATE TABLE table_name_20 ( date VARCHAR, home_team VARCHAR )...
What is 2004, when 2009 is 'A'?
CREATE TABLE table_name_28 ( Id VARCHAR )
SELECT 2004 FROM table_name_28 WHERE 2009 = "a"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is 2004, when 2009 is 'A'? ### Input: CREATE TABLE table_name_28 ( Id VARCHAR ) ### Response: SELECT 2004 FROM tabl...
How many allergies are there?
CREATE TABLE Allergy_type ( allergy VARCHAR )
SELECT COUNT(DISTINCT allergy) FROM Allergy_type
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many allergies are there? ### Input: CREATE TABLE Allergy_type ( allergy VARCHAR ) ### Response: SELECT COUNT(DISTIN...
what flights from NEW YORK to LOS ANGELES
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank i...
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 = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS A...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what flights from NEW YORK to LOS ANGELES ### Input: CREATE TABLE fare ( fare_id int, from_airport varchar, to_a...
How many games or records were played on the Miami Orange Bowl?
CREATE TABLE table_17386066_2 ( record VARCHAR, stadium VARCHAR )
SELECT COUNT(record) FROM table_17386066_2 WHERE stadium = "Miami Orange Bowl"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many games or records were played on the Miami Orange Bowl? ### Input: CREATE TABLE table_17386066_2 ( record VARCHA...
Compare the number of the names of phones by a bar chart.
CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Rankin...
SELECT Name, COUNT(Name) FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID 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: Compare the number of the names of phones by a bar chart. ### Input: CREATE TABLE phone_market ( Market_ID int, Phon...
A bar chart shows the distribution of meter_200 and the sum of ID , and group by attribute meter_200.
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimme...
SELECT meter_200, SUM(ID) FROM swimmer GROUP BY meter_200
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart shows the distribution of meter_200 and the sum of ID , and group by attribute meter_200. ### Input: CREATE TABL...
What is the code of each location and the number of documents in that location Show bar chart, and could you show bar in desc order?
CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME, Actual_Destruction_Date DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Co...
SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code ORDER BY Location_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: What is the code of each location and the number of documents in that location Show bar chart, and could you show bar in des...
When did South Melbourne play at home?
CREATE TABLE table_33159 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Date" FROM table_33159 WHERE "Home team" = 'south 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: When did South Melbourne play at home? ### Input: CREATE TABLE table_33159 ( "Home team" text, "Home team score" tex...
For those employees who was hired before 2002-06-21, a bar chart shows the distribution of job_id and the sum of salary , and group by attribute job_id, and could you rank by the x axis in desc?
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' 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 who was hired before 2002-06-21, a bar chart shows the distribution of job_id and the sum of salary , an...
give me the number of patients whose ethnicity is black/cape verdean and primary disease is acidosis?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "ACIDOSIS"
Below are sql tables 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 black/cape verdean and primary disease is acidosis? ### Input: CREATE TABL...
What is the losses average when the against is greater than 1255 and wins is 0 and the draws less than 0?
CREATE TABLE table_name_43 ( losses INTEGER, draws VARCHAR, against VARCHAR, wins VARCHAR )
SELECT AVG(losses) FROM table_name_43 WHERE against > 1255 AND wins = 0 AND draws < 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 losses average when the against is greater than 1255 and wins is 0 and the draws less than 0? ### Input: CREATE ...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the average of manager_id over the hire_date bin hire_date by time, and list Y in descending order please.
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLO...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(MANAGER_ID) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison a...
Set 1 of 25 20, what was Set 2?
CREATE TABLE table_46027 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text )
SELECT "Set 2" FROM table_46027 WHERE "Set 1" = '25–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: Set 1 of 25 20, what was Set 2? ### Input: CREATE TABLE table_46027 ( "Date" text, "Time" text, "Score" text, ...
i need to book a flight from NEWARK to TAMPA on 4 4
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TAMPA' AND date_day.day_number = 4 AND date_day.month_number = 4 AND date...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: i need to book a flight from NEWARK to TAMPA on 4 4 ### Input: CREATE TABLE flight_fare ( flight_id int, fare_id int...
What are the names, and revenues for manufacturers, sorted by revenue descending in a bar graph?
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, Revenue FROM Manufacturers ORDER BY 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: What are the names, and revenues for manufacturers, sorted by revenue descending in a bar graph? ### Input: CREATE TABLE Man...
What is the relationship between author_id and author_tutor_ATB ?
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Subject...
SELECT author_id, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_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: What is the relationship between author_id and author_tutor_ATB ? ### Input: CREATE TABLE Course_Authors_and_Tutors ( au...
Show the order ids and the number of invoices for each order.
CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME ) CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80), product_quantity VARCHAR(50), product_price DECIMAL(19,4), de...
SELECT order_id, COUNT(*) FROM Invoices GROUP BY order_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: Show the order ids and the number of invoices for each order. ### Input: CREATE TABLE Invoices ( invoice_number INTEGER,...
i mean how many hours has it been since the first time patient 15794 had a gastric meds intake on the current icu visit?
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15794) 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: i mean how many hours has it been since the first time patient 15794 had a gastric meds intake on the current icu visit? ###...
What is the dominate religion in the location with a population of 4831?
CREATE TABLE table_2562572_12 ( dominant_religion__2002_ VARCHAR, population__2011_ VARCHAR )
SELECT dominant_religion__2002_ FROM table_2562572_12 WHERE population__2011_ = 4831
Below are sql tables 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 dominate religion in the location with a population of 4831? ### Input: CREATE TABLE table_2562572_12 ( domi...
What is the location for the club trophy from the year 1867 only?
CREATE TABLE table_59329 ( "Years" text, "Type" text, "Original code" text, "Current code" text, "Location" text )
SELECT "Location" FROM table_59329 WHERE "Type" = 'club trophy' AND "Years" = '1867 only'
Below are sql tables 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 location for the club trophy from the year 1867 only? ### Input: CREATE TABLE table_59329 ( "Years" text, ...
Which H/A/N has a score of 105* ?
CREATE TABLE table_61520 ( "Score" text, "Pos." real, "Inn." real, "Venue" text, "H/A/N" text )
SELECT "H/A/N" FROM table_61520 WHERE "Score" = '105*♠'
Below are sql tables 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 H/A/N has a score of 105* ? ### Input: CREATE TABLE table_61520 ( "Score" text, "Pos." real, "Inn." real, ...
was patient 12274 given any sort of diagnosis this year?
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, ...
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12274) AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: was patient 12274 given any sort of diagnosis this year? ### Input: CREATE TABLE d_items ( row_id number, itemid num...
what was the last released featured performance by notorious b.i.g.
CREATE TABLE table_203_11 ( id number, "title" text, "year" number, "peak chart positions\nus" number, "peak chart positions\nus r&b" number, "peak chart positions\nus rap" number, "peak chart positions\nuk" number, "certifications" text, "album" text )
SELECT "title" FROM table_203_11 ORDER BY id 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 was the last released featured performance by notorious b.i.g. ### Input: CREATE TABLE table_203_11 ( id number, ...
what is the number of patients whose ethnicity is black/haitian and age is less than 80?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/HAITIAN" AND demographic.age < "80"
Below are sql tables 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 ethnicity is black/haitian and age is less than 80? ### Input: CREATE TABLE prescriptio...
how many patients diagnosed with regional enteritis nos are administered drugs via the left eye?
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Regional enteritis NOS" AND prescriptions.route = "LEFT EYE"
Below are sql tables 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 diagnosed with regional enteritis nos are administered drugs via the left eye? ### Input: CREATE TABLE pro...
Who had the most assists and how many did they have on January 5?
CREATE TABLE table_29556461_7 ( high_assists VARCHAR, date VARCHAR )
SELECT high_assists FROM table_29556461_7 WHERE date = "January 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: Who had the most assists and how many did they have on January 5? ### Input: CREATE TABLE table_29556461_7 ( high_assist...
In what state was the electorate fowler?
CREATE TABLE table_name_1 ( state VARCHAR, electorate VARCHAR )
SELECT state FROM table_name_1 WHERE electorate = "fowler"
Below are sql tables 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 what state was the electorate fowler? ### Input: CREATE TABLE table_name_1 ( state VARCHAR, electorate VARCHAR ) ...
what is the lowest played when the position is more than 9?
CREATE TABLE table_8628 ( "Position" real, "Name" text, "Played" real, "Drawn" real, "Lost" real, "Points" real )
SELECT MIN("Played") FROM table_8628 WHERE "Position" > '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 lowest played when the position is more than 9? ### Input: CREATE TABLE table_8628 ( "Position" real, "N...
give me the number of patients whose age is less than 20 and drug name is clofarabine *ind*?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "20" AND prescriptions.drug = "Clofarabine *IND*"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose age is less than 20 and drug name is clofarabine *ind*? ### Input: CREATE TABLE lab ( ...
what flights depart BALTIMORE on friday and arrive in SAN FRANCISCO by 2000
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_descriptio...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 25 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.arrival_time <...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what flights depart BALTIMORE on friday and arrive in SAN FRANCISCO by 2000 ### Input: CREATE TABLE fare_basis ( fare_ba...
Which building has the largest number of company offices? Give me the building name.
CREATE TABLE buildings ( id number, name text, city text, height number, stories number, status text ) CREATE TABLE office_locations ( building_id number, company_id number, move_in_year number ) CREATE TABLE companies ( id number, name text, headquarters text, indu...
SELECT T2.name FROM office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id 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 building has the largest number of company offices? Give me the building name. ### Input: CREATE TABLE buildings ( ...
Bar graph to show meter_100 from different meter 400, and show in descending by the total number.
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text...
SELECT meter_400, meter_100 FROM swimmer ORDER BY meter_100 DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar graph to show meter_100 from different meter 400, and show in descending by the total number. ### Input: CREATE TABLE ev...
is the value of pco2 of patient 49295 measured at 2103-06-12 04:15:00 greater than the value measured at 2103-06-10 21:14:00?
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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime tim...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49295) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'pco2') AND labevents.charttime = '2103-06-12 04:15:00') > (SELECT 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: is the value of pco2 of patient 49295 measured at 2103-06-12 04:15:00 greater than the value measured at 2103-06-10 21:14:00...
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 sum of salary bin hire_date by weekday, and display sum salary in desc order.
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 locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(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: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ...
Find the number of trains starting from each origin. Plot them as bar chart.
CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE route ( train_id int, station_id int ) CREATE TA...
SELECT origin, COUNT(*) FROM train GROUP BY origin
Below are sql tables 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 number of trains starting from each origin. Plot them as bar chart. ### Input: CREATE TABLE train ( id int, ...
what was the top three most common procedures that followed within the same month for patients who were given aortocor bypas-3 cor art during this year?
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE icustays ...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi...
Below are sql tables 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 top three most common procedures that followed within the same month for patients who were given aortocor bypas...
The score of 73-71-70=214 belongs to what country?
CREATE TABLE table_name_77 ( country VARCHAR, score VARCHAR )
SELECT country FROM table_name_77 WHERE score = 73 - 71 - 70 = 214
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: The score of 73-71-70=214 belongs to what country? ### Input: CREATE TABLE table_name_77 ( country VARCHAR, score VA...
who is the the incumbent with district being ohio 2
CREATE TABLE table_1342013_34 ( incumbent VARCHAR, district VARCHAR )
SELECT incumbent FROM table_1342013_34 WHERE district = "Ohio 2"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who is the the incumbent with district being ohio 2 ### Input: CREATE TABLE table_1342013_34 ( incumbent VARCHAR, di...
what was the name of an organism which was found in the last sputum microbiology test of patient 22648 during their current hospital encounter?
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 microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22648 AND admissions.dischtime IS NULL) AND microbiologyevents.spec_type_desc = 'sputum' AND NOT microbiologyevents.org_name IS NULL ORDER BY microbiolo...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of an organism which was found in the last sputum microbiology test of patient 22648 during their current ...
What is Name, when Games are less than 38, when Rank is less than 4, and when Points are 357?
CREATE TABLE table_42021 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Points" real )
SELECT "Name" FROM table_42021 WHERE "Games" < '38' AND "Rank" < '4' AND "Points" = '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 Name, when Games are less than 38, when Rank is less than 4, and when Points are 357? ### Input: CREATE TABLE table_...
What does Prof. Kristina Daugirdas teach ?
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE requirement ( ...
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 '%Kristina Daugirdas%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering...
Below are sql tables 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 does Prof. Kristina Daugirdas teach ? ### Input: CREATE TABLE jobs ( job_id int, job_title varchar, descrip...
What is the sum number of year when Call of Duty 4: Modern Warfare was the game?
CREATE TABLE table_name_55 ( year VARCHAR, game VARCHAR )
SELECT COUNT(year) FROM table_name_55 WHERE game = "call of duty 4: modern warfare"
Below are sql tables 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 number of year when Call of Duty 4: Modern Warfare was the game? ### Input: CREATE TABLE table_name_55 ( ...
What are the colors of the team hosted by Christopher?
CREATE TABLE table_name_77 ( colors VARCHAR, host VARCHAR )
SELECT colors FROM table_name_77 WHERE host = "christopher"
Below are sql tables 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 colors of the team hosted by Christopher? ### Input: CREATE TABLE table_name_77 ( colors VARCHAR, host ...
What is Rank, when Event is 'LAPT4 S o Paulo'?
CREATE TABLE table_name_66 ( rank VARCHAR, event VARCHAR )
SELECT rank FROM table_name_66 WHERE event = "lapt4 são paulo"
Below are sql tables 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 Rank, when Event is 'LAPT4 S o Paulo'? ### Input: CREATE TABLE table_name_66 ( rank VARCHAR, event VARCHAR )...
Name the catalog number for am/pm callanetics
CREATE TABLE table_74090 ( "Year" real, "Title" text, "Format" text, "Studio" text, "Release Date" text, "Copyright Information" text, "Catalog Number" text )
SELECT "Catalog Number" FROM table_74090 WHERE "Title" = 'AM/PM Callanetics'
Below are sql tables 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 catalog number for am/pm callanetics ### Input: CREATE TABLE table_74090 ( "Year" real, "Title" text, "...
Name the played with points against of points against
CREATE TABLE table_71375 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
SELECT "Played" FROM table_71375 WHERE "Points against" = 'points against'
Below are sql tables 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 played with points against of points against ### Input: CREATE TABLE table_71375 ( "Club" text, "Played" te...
At a Saginaw fare of $470.47, what is the fare to Lansing?
CREATE TABLE table_20700 ( "Year" real, "Lansing (LAN)" text, "Detroit (DTW)" text, "Grand Rapids (GRR)" text, "Flint (FNT)" text, "Kalamazoo (AZO)" text, "Saginaw (MBS)" text )
SELECT "Lansing (LAN)" FROM table_20700 WHERE "Saginaw (MBS)" = '$470.47'
Below are sql tables 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 a Saginaw fare of $470.47, what is the fare to Lansing? ### Input: CREATE TABLE table_20700 ( "Year" real, "Lansi...
What was the Tie Number of the Bradford City away team?
CREATE TABLE table_name_7 ( tie_no VARCHAR, away_team VARCHAR )
SELECT tie_no FROM table_name_7 WHERE away_team = "bradford city"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the Tie Number of the Bradford City away team? ### Input: CREATE TABLE table_name_7 ( tie_no VARCHAR, away_...
If 2006 is 13% and 2001 is greater than 12.1%, what is the greatest number of seats for 2001?
CREATE TABLE table_name_71 ( seats_2001 INTEGER, _percentage_2006 VARCHAR, _percentage_2001 VARCHAR )
SELECT MAX(seats_2001) FROM table_name_71 WHERE _percentage_2006 = 13 AND _percentage_2001 > 12.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: If 2006 is 13% and 2001 is greater than 12.1%, what is the greatest number of seats for 2001? ### Input: CREATE TABLE table_...
give me the number of patients whose admission location is phys referral/normal deli and diagnoses short title is heart valve transplant?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND diagnoses.short_title = "Heart valve transplant"
Below are sql tables 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 location is phys referral/normal deli and diagnoses short title is heart valv...
what is the number of patients less than 70 years who were admitted to hospital before 2180?
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.age < "70" AND demographic.admityear < "2180"
Below are sql tables 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 less than 70 years who were admitted to hospital before 2180? ### Input: CREATE TABLE demogra...
How many drivers did Bob Gerard Racing have?
CREATE TABLE table_24685 ( "No" real, "Driver" text, "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text )
SELECT COUNT("Driver") FROM table_24685 WHERE "Entrant" = 'Bob Gerard Racing'
Below are sql tables 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 drivers did Bob Gerard Racing have? ### Input: CREATE TABLE table_24685 ( "No" real, "Driver" text, "En...
Please give me a pie chart to show the proportion of all players' genders.
CREATE TABLE player_coach ( Player_ID int, Coach_ID int, Starting_year int ) CREATE TABLE coach ( Coach_ID int, Coach_name text, Gender text, Club_ID int, Rank int ) CREATE TABLE match_result ( Rank int, Club_ID int, Gold int, Big_Silver int, Small_Silver int, B...
SELECT Gender, COUNT(Gender) FROM player GROUP BY Gender
Below are sql tables 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 give me a pie chart to show the proportion of all players' genders. ### Input: CREATE TABLE player_coach ( Player...
What's the number of the episode with production code 2395118?
CREATE TABLE table_16373 ( "No. in series" real, "No. in season" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Production code" text )
SELECT "No. in season" FROM table_16373 WHERE "Production code" = '2395118'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the number of the episode with production code 2395118? ### Input: CREATE TABLE table_16373 ( "No. in series" rea...
what is the drug route of the drug code dones?
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 prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "DONE5"
Below are sql tables 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 drug route of the drug code dones? ### Input: CREATE TABLE lab ( subject_id text, hadm_id text, item...
What Game site has an Opponent of Miami Dolphins?
CREATE TABLE table_39100 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" real )
SELECT "Game site" FROM table_39100 WHERE "Opponent" = 'miami dolphins'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Game site has an Opponent of Miami Dolphins? ### Input: CREATE TABLE table_39100 ( "Week" real, "Date" text, ...
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and code , and group by attribute founder, and show Y in asc order please.
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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.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: For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and c...
What is listed for the Lengtht that has a Version of Single Version?
CREATE TABLE table_4994 ( "Version" text, "Length" text, "Album" text, "Remixed by" text, "Year" real )
SELECT "Length" FROM table_4994 WHERE "Version" = 'single version'
Below are sql tables 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 listed for the Lengtht that has a Version of Single Version? ### Input: CREATE TABLE table_4994 ( "Version" text...
what kind of airline is flight UA 281 from BOSTON to DENVER
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) C...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what kind of airline is flight UA 281 from BOSTON to DENVER ### Input: CREATE TABLE month ( month_number int, month_...
has patient 26612 received until 2104 a test for anion gap?
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'anion gap') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26612) AND STRFTIME('%y', labevents.charttime) <= '2104'
Below are sql tables 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 26612 received until 2104 a test for anion gap? ### Input: CREATE TABLE transfers ( row_id number, subje...
what is the number of urgent hospital admission patients who had closed biopsy of bronchus?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Closed bronchial biopsy"
Below are sql tables 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 urgent hospital admission patients who had closed biopsy of bronchus? ### Input: CREATE TABLE demograp...
Show the number of courses for each office in a bar chart, and I want to display X in ascending order please.
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varch...
SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY PROF_OFFICE ORDER BY PROF_OFFICE
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the number of courses for each office in a bar chart, and I want to display X in ascending order please. ### Input: CRE...