instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
For all employees who have the letters D or S in their first name, show me about the distribution of job_id and the average of manager_id , and group by attribute job_id in a bar chart, rank JOB_ID 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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0...
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' 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 all employees who have the letters D or S in their first name, show me about the distribution of job_id and the average ...
Which location includes Coast Mountains with a rank less than 18 at Skihist Mountain?
CREATE TABLE table_name_41 ( location VARCHAR, mountain_peak VARCHAR, mountain_range VARCHAR, rank VARCHAR )
SELECT location FROM table_name_41 WHERE mountain_range = "coast mountains" AND rank < 18 AND mountain_peak = "skihist mountain"
Below are sql tables 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 location includes Coast Mountains with a rank less than 18 at Skihist Mountain? ### Input: CREATE TABLE table_name_41 ...
provide the number of patients whose admission year is less than 2170 and drug name is atorvastatin?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2170" AND prescriptions.drug = "Atorvastatin"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose admission year is less than 2170 and drug name is atorvastatin? ### Input: CREATE TABLE...
Which opponent has a time of 2:35?
CREATE TABLE table_38728 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
SELECT "Opponent" FROM table_38728 WHERE "Time" = '2:35'
Below are sql tables 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 opponent has a time of 2:35? ### Input: CREATE TABLE table_38728 ( "Res." text, "Record" text, "Opponent" ...
when in 05/this year was patient 3939's last test for po2?
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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, chart...
SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'po2') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3939) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when in 05/this year was patient 3939's last test for po2? ### Input: CREATE TABLE transfers ( row_id number, subjec...
Find the number of trains starting from each origin Plot them as bar chart, and sort bar in ascending order.
CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperat...
SELECT origin, COUNT(*) FROM train GROUP BY origin ORDER 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, and sort bar in ascending order. ### Input: CREA...
how many patients have the drug route as id?
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.route = "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: how many patients have the drug route as id? ### Input: CREATE TABLE procedures ( subject_id text, hadm_id text, ...
provide the number of male patients who underwent other percutaneous procedures on biliary tract.
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.long_title = "Other percutaneous procedures on biliary tract"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of male patients who underwent other percutaneous procedures on biliary tract. ### Input: CREATE TABLE pr...
what is the date when scorers is parkinson?
CREATE TABLE table_name_23 ( date VARCHAR, scorers VARCHAR )
SELECT date FROM table_name_23 WHERE scorers = "parkinson"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the date when scorers is parkinson? ### Input: CREATE TABLE table_name_23 ( date VARCHAR, scorers VARCHAR ) ...
How many patients with ulcer of an other part of the foot stayed at hospital for more than 3 days?
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 demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "3" AND diagnoses.long_title = "Ulcer of other part of foot"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many patients with ulcer of an other part of the foot stayed at hospital for more than 3 days? ### Input: CREATE TABLE l...
What was the location attendance on the date of November 15?
CREATE TABLE table_17305 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT "Location Attendance" FROM table_17305 WHERE "Date" = 'November 15'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the location attendance on the date of November 15? ### Input: CREATE TABLE table_17305 ( "Game" real, "Dat...
List all titles with a 57 series number.
CREATE TABLE table_29485 ( "No. in Series" real, "No. in Season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
SELECT "Title" FROM table_29485 WHERE "No. in Series" = '57'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List all titles with a 57 series number. ### Input: CREATE TABLE table_29485 ( "No. in Series" real, "No. in Season"...
what were the three most frequent lab tests those patients had within 2 months after having had a inject ca chemother nec procedure until 2103?
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microb...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, 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 = admissions.hadm_id WHERE procedures_i...
Below are sql tables 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 three most frequent lab tests those patients had within 2 months after having had a inject ca chemother nec pr...
What week was the bye week?
CREATE TABLE table_9546 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
SELECT AVG("Week") FROM table_9546 WHERE "Opponent" = 'bye'
Below are sql tables 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 week was the bye week? ### Input: CREATE TABLE table_9546 ( "Week" real, "Date" text, "Opponent" text, ...
How many classes in the Fall and Winter term are 500 -level classes ?
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, ins...
SELECT COUNT(DISTINCT course.course_id, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 500 AND 500 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_id = course_offering.semester...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many classes in the Fall and Winter term are 500 -level classes ? ### Input: CREATE TABLE program_requirement ( prog...
What is the video ratio on channel 14.2?
CREATE TABLE table_name_75 ( video VARCHAR, channel VARCHAR )
SELECT video FROM table_name_75 WHERE channel = 14.2
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the video ratio on channel 14.2? ### Input: CREATE TABLE table_name_75 ( video VARCHAR, channel VARCHAR ) ##...
List the number of each company whose office is in the building in a bar chart, list by the x-axis in asc.
CREATE TABLE buildings ( id int, name text, City text, Height int, Stories int, Status text ) CREATE TABLE Office_locations ( building_id int, company_id int, move_in_year int ) CREATE TABLE Companies ( id int, name text, Headquarters text, Industry text, Sales_...
SELECT T3.name, COUNT(T3.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 T3.name ORDER BY T3.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: List the number of each company whose office is in the building in a bar chart, list by the x-axis in asc. ### Input: CREATE...
Who was the away team when Carlton was the home team?
CREATE TABLE table_14312471_1 ( away_team VARCHAR, home_team VARCHAR )
SELECT away_team FROM table_14312471_1 WHERE home_team = "Carlton"
Below are sql tables 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 away team when Carlton was the home team? ### Input: CREATE TABLE table_14312471_1 ( away_team VARCHAR, ...
how many government health insurance patients were tranferred within their own facility?
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 WHERE demographic.insurance = "Government" AND demographic.admission_location = "TRSF WITHIN THIS FACILITY"
Below are sql tables 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 government health insurance patients were tranferred within their own facility? ### Input: CREATE TABLE procedures ...
For those records from the products and each product's manufacturer, give me the comparison about the average of code over the name , and group by attribute name, I want to list from high to low by the total number.
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 T1.Name ORDER BY T1.Code DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, give me the comparison about the average of code over t...
Find the names of Japanese constructors that have once earned more than 5 points, and count them by a pie chart
CREATE TABLE pitStops ( raceId INTEGER, driverId INTEGER, stop INTEGER, lap INTEGER, time TEXT, duration TEXT, milliseconds INTEGER ) CREATE TABLE drivers ( driverId INTEGER, driverRef TEXT, number TEXT, code TEXT, forename TEXT, surname TEXT, dob TEXT, natio...
SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 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: Find the names of Japanese constructors that have once earned more than 5 points, and count them by a pie chart ### Input: C...
what are the flights available between 1000 and 1500 between PITTSBURGH and FORT WORTH
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE dual_carrier...
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 ((flight.departure_time <= 1500 AND flight.departure_time >= 1000) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'FORT WORTH' AND fli...
Below are sql tables 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 flights available between 1000 and 1500 between PITTSBURGH and FORT WORTH ### Input: CREATE TABLE flight_stop (...
Give me a bar chart for the total number of each payment method code, and show in descending by the Y-axis.
CREATE TABLE Ref_Payment_Methods ( payment_method_code CHAR(10), payment_method_description VARCHAR(80) ) CREATE TABLE Bookings_Services ( Order_ID INTEGER, Product_ID INTEGER ) CREATE TABLE Clients ( Client_ID INTEGER, Address_ID INTEGER, Customer_Email_Address VARCHAR(255), Customer_...
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code 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: Give me a bar chart for the total number of each payment method code, and show in descending by the Y-axis. ### Input: CREAT...
count the number of patients who are dead after being diagnosed with delirium within the same hospital visit in this year.
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE patient ( uniquep...
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ...
Below are sql tables 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 are dead after being diagnosed with delirium within the same hospital visit in this year. #...
during this year, what are the three most frequent drugs prescribed within the same month to the patients aged 50s after abn react-radiotherapy has been diagnosed?
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime ti...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: during this year, what are the three most frequent drugs prescribed within the same month to the patients aged 50s after abn...
Show the average salary by each hire date of employees, and please bin the hire date into the day of week interval for showing a bar chart, could you order by the Y 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 employees ( EMPLOYEE_I...
SELECT HIRE_DATE, AVG(SALARY) FROM employees ORDER BY AVG(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: Show the average salary by each hire date of employees, and please bin the hire date into the day of week interval for showi...
What are the ids and names of the medicine that can interact with two or more enzymes?
CREATE TABLE medicine_enzyme_interaction ( medicine_id VARCHAR ) CREATE TABLE medicine ( id VARCHAR, Name VARCHAR )
SELECT T1.id, T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the ids and names of the medicine that can interact with two or more enzymes? ### Input: CREATE TABLE medicine_enzy...
What party did incumbent Wright Patman belong to?
CREATE TABLE table_18521 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
SELECT "Party" FROM table_18521 WHERE "Incumbent" = 'Wright Patman'
Below are sql tables 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 party did incumbent Wright Patman belong to? ### Input: CREATE TABLE table_18521 ( "District" text, "Incumbent"...
Who is the easiest MDE course taught by ?
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course...
SELECT DISTINCT instructor.name, program_course.workload FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN program_course ON program_course.course_id = cour...
Below are sql tables 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 easiest MDE course taught by ? ### Input: CREATE TABLE instructor ( instructor_id int, name varchar, ...
what country lost the most ships to u-502 ?
CREATE TABLE table_203_268 ( id number, "date" text, "name" text, "nationality" text, "tonnage\n(grt)" number, "fate" text )
SELECT "nationality" FROM table_203_268 GROUP BY "nationality" ORDER BY COUNT("name") 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 country lost the most ships to u-502 ? ### Input: CREATE TABLE table_203_268 ( id number, "date" text, "nam...
what were the drugs which were added to patient 021-80293 today compared to the ones yesterday?
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 medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '021-80293') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica...
Below are sql tables 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 drugs which were added to patient 021-80293 today compared to the ones yesterday? ### Input: CREATE TABLE trea...
in april 13 who made the high rebounds
CREATE TABLE table_31447 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "Location Attendance" text, "Series" text, "Streak" text )
SELECT "High rebounds" FROM table_31447 WHERE "Date" = 'April 13'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: in april 13 who made the high rebounds ### Input: CREATE TABLE table_31447 ( "Game" real, "Date" text, "Team" te...
I want the constructor for grid less than 20 and Laps of 6
CREATE TABLE table_name_68 ( constructor VARCHAR, grid VARCHAR, laps VARCHAR )
SELECT constructor FROM table_name_68 WHERE grid < 20 AND laps = 6
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: I want the constructor for grid less than 20 and Laps of 6 ### Input: CREATE TABLE table_name_68 ( constructor VARCHAR, ...
Return a bar chart on what are the apartment number and the room count of each apartment?
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Apartment_Facilities ( apt_id I...
SELECT apt_number, room_count FROM Apartments
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart on what are the apartment number and the room count of each apartment? ### Input: CREATE TABLE Apartment_...
What is the total number of every ship type by categorizing by nationality?, and could you sort in desc by the the number of type please?
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text )
SELECT Type, COUNT(Type) FROM ship GROUP BY Nationality, Type ORDER BY COUNT(Type) 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 total number of every ship type by categorizing by nationality?, and could you sort in desc by the the number of...
What is the Median family income when the Median household income is $38,137?
CREATE TABLE table_name_8 ( median_family_income VARCHAR, median_household_income VARCHAR )
SELECT median_family_income FROM table_name_8 WHERE median_household_income = "$38,137"
Below are sql tables 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 Median family income when the Median household income is $38,137? ### Input: CREATE TABLE table_name_8 ( med...
Give me the comparison about Team_ID over the All_Road by a bar chart, could you rank from high to low by the X-axis?
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Road, Team_ID FROM basketball_match ORDER BY All_Road 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 the comparison about Team_ID over the All_Road by a bar chart, could you rank from high to low by the X-axis? ### In...
Show me a pie chart for how many documents are there of each type?
CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Desc...
SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me a pie chart for how many documents are there of each type? ### Input: CREATE TABLE Accounts ( Account_ID INTEGER...
If I want to declare a major in DHYGRACK , then what classes to do I need to take ?
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, ...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%DHYGRACK%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If I want to declare a major in DHYGRACK , then what classes to do I need to take ? ### Input: CREATE TABLE area ( cours...
how many patients were prescribed with docusate sodium within 2 months after the procedure of non-invasive mech vent, in 2102?
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 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 = 'non-invasiv...
Below are sql tables 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 were prescribed with docusate sodium within 2 months after the procedure of non-invasive mech vent, in 210...
Calculate the number of patients who have been diagnosed with hypospadias that have a delta lab test status.
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Hypospadias" AND lab.flag = "delta"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Calculate the number of patients who have been diagnosed with hypospadias that have a delta lab test status. ### Input: CREA...
count the number of patients whose ethnicity is black/haitian and drug name is phenylephrine?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND prescriptions.drug = "Phenylephrine"
Below are sql tables 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 ethnicity is black/haitian and drug name is phenylephrine? ### Input: CREATE TABLE diagno...
What is the number of patients who have diagnoses of elevated levels of transaminase and lactic acid dehydrogenase and were ordered other body fluid lab tests.
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Elev transaminase/ldh" AND lab.fluid = "Other Body Fluid"
Below are sql tables 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 who have diagnoses of elevated levels of transaminase and lactic acid dehydrogenase and were ...
What is the average price for each type of product?
CREATE TABLE products ( product_type_code VARCHAR, product_price INTEGER )
SELECT product_type_code, AVG(product_price) FROM products GROUP BY product_type_code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average price for each type of product? ### Input: CREATE TABLE products ( product_type_code VARCHAR, pr...
what were the three most frequently prescribed drugs at the same time, in this year, among the patients who were prescribed with buffered lidocaine 1%?
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE patient ( uniquep...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'buffered lidocaine 1%' AND DATETIME(medication.drug...
Below are sql tables 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 three most frequently prescribed drugs at the same time, in this year, among the patients who were prescribed ...
List all payment methods and number of payments using each payment methods Plot them as bar chart, display names in ascending order please.
CREATE TABLE Customer_Payments ( customer_id INTEGER, datetime_payment DATETIME, payment_method_code VARCHAR(10), amount_payment DOUBLE ) CREATE TABLE Vehicles ( vehicle_id INTEGER, vehicle_details VARCHAR(255) ) CREATE TABLE Customers ( customer_id INTEGER, customer_address_id INTEGER...
SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code ORDER BY payment_method_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: List all payment methods and number of payments using each payment methods Plot them as bar chart, display names in ascendin...
Which driver has 45 laps?
CREATE TABLE table_53735 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT "Driver" FROM table_53735 WHERE "Laps" = '45'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which driver has 45 laps? ### Input: CREATE TABLE table_53735 ( "Driver" text, "Constructor" text, "Laps" real, ...
For those records from the products and each product's manufacturer, show me about the distribution of name and price , and group by attribute founder in a bar chart, and could you sort X-axis in descending order?
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name 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, show me about the distribution of name and price , and ...
Which catalog is in cd format?
CREATE TABLE table_79942 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
SELECT "Catalog" FROM table_79942 WHERE "Format" = 'cd'
Below are sql tables 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 catalog is in cd format? ### Input: CREATE TABLE table_79942 ( "Region" text, "Date" text, "Label" text, ...
What was the record on July 2?
CREATE TABLE table_68860 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
SELECT "Record" FROM table_68860 WHERE "Date" = 'july 2'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the record on July 2? ### Input: CREATE TABLE table_68860 ( "Date" text, "Opponent" text, "Score" text,...
provide the name of drug and route of administration for the drug with drug code d12.5w250l.
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.drug, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "D12.5W250I"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the name of drug and route of administration for the drug with drug code d12.5w250l. ### Input: CREATE TABLE lab ( ...
which attendance has a Loss of drese (0-2)?
CREATE TABLE table_34891 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
SELECT "Attendance" FROM table_34891 WHERE "Loss" = 'drese (0-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 attendance has a Loss of drese (0-2)? ### Input: CREATE TABLE table_34891 ( "Date" text, "Opponent" text, ...
On what date did the away team score 12.9 (81)?
CREATE TABLE table_33044 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Date" FROM table_33044 WHERE "Away team score" = '12.9 (81)'
Below are sql tables 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 the away team score 12.9 (81)? ### Input: CREATE TABLE table_33044 ( "Home team" text, "Home team s...
the systemicsystolic of patient 016-6009 last measured on the last intensive care unit visit was less than the first value measured on the last intensive care unit visit?
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT (SELECT vitalperiodic.systemicsystolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-6009') AND NOT patient.unitdischargeti...
Below are sql tables 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 systemicsystolic of patient 016-6009 last measured on the last intensive care unit visit was less than the first value m...
What is the total number of purchases for members with level 6?
CREATE TABLE purchase ( member_id VARCHAR ) CREATE TABLE member ( member_id VARCHAR, level VARCHAR )
SELECT COUNT(*) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T2.level = 6
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of purchases for members with level 6? ### Input: CREATE TABLE purchase ( member_id VARCHAR ) ...
what is diagnoses long title and procedure long title of subject id 22377?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT diagnoses.long_title, procedures.long_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "22377"
Below are sql tables 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 diagnoses long title and procedure long title of subject id 22377? ### Input: CREATE TABLE diagnoses ( subject_i...
Among patients admitted before the year 2131, how many of them had a lab test for albumin/creatinine, urine?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2131" AND lab.label = "Albumin/Creatinine, Urine"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Among patients admitted before the year 2131, how many of them had a lab test for albumin/creatinine, urine? ### Input: CREA...
how many patients whose admission year is less than 2187 and drug name is neo*iv*gentamicin?
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2187" AND prescriptions.drug = "NEO*IV*Gentamicin"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose admission year is less than 2187 and drug name is neo*iv*gentamicin? ### Input: CREATE TABLE lab ( ...
find the minimum age of patients who were admitted in emergency in or after the year 2175.
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.admityear >= "2175"
Below are sql tables 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 minimum age of patients who were admitted in emergency in or after the year 2175. ### Input: CREATE TABLE procedure...
Find the number of patients who have iv bolus route of drug administration with a diagnoses of personal history of transient ischemic attack and cerebral infarction without residual deficits.
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hx TIA/stroke w/o resid" AND prescriptions.route = "IV BOLUS"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of patients who have iv bolus route of drug administration with a diagnoses of personal history of transient...
i need a flight from NEWARK to LOS ANGELES leaving tomorrow evening
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fl...
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 = 'LOS ANGELES' AND date_day.day_number = 20 AND date_day.month_number = 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: i need a flight from NEWARK to LOS ANGELES leaving tomorrow evening ### Input: CREATE TABLE dual_carrier ( main_airline ...
Tag wikis with internal http:// links ordered by use.
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
SELECT DISTINCT Tags.Id, Tags.Count, Tags.TagName, 'site://tags/' + Tags.TagName + '/info|Url' AS Url FROM Tags LEFT JOIN Posts ON Posts.Id = Tags.WikiPostId OR Posts.Id = Tags.ExcerptPostId WHERE (LOWER(Posts.Body) LIKE '%http://%.stackexchange.com%' OR LOWER(Posts.Body) LIKE '%http://stackexchange.com%' OR LOWER(Post...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tag wikis with internal http:// links ordered by use. ### Input: CREATE TABLE PendingFlags ( Id number, FlagTypeId n...
A bar chart about what is average age for different job title?
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT )
SELECT job, AVG(age) FROM Person GROUP BY job
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart about what is average age for different job title? ### Input: CREATE TABLE PersonFriend ( name varchar(20), ...
what is the number of patients whose admission type is urgent and lab test fluid is ascites?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.fluid = "Ascites"
Below are sql tables 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 admission type is urgent and lab test fluid is ascites? ### Input: CREATE TABLE diagnos...
provide the number of patients whose admission type is urgent and lab test category is hematology?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab."CATEGORY" = "Hematology"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose admission type is urgent and lab test category is hematology? ### Input: CREATE TABLE p...
Which Laps have a Manufacturer of suzuki, and a Grid smaller than 16?
CREATE TABLE table_name_93 ( laps INTEGER, manufacturer VARCHAR, grid VARCHAR )
SELECT MAX(laps) FROM table_name_93 WHERE manufacturer = "suzuki" AND grid < 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: Which Laps have a Manufacturer of suzuki, and a Grid smaller than 16? ### Input: CREATE TABLE table_name_93 ( laps INTEG...
does patient 12568 ever underwent a base excess test?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, chartt...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'base excess') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12568)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: does patient 12568 ever underwent a base excess test? ### Input: CREATE TABLE d_labitems ( row_id number, itemid num...
What are all the dates with a score of 203 (-13)?
CREATE TABLE table_16954 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" real )
SELECT "Date" FROM table_16954 WHERE "Score" = '203 (-13)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are all the dates with a score of 203 (-13)? ### Input: CREATE TABLE table_16954 ( "Date" text, "Tournament" te...
What was the production in 2002-03 for the commodity that produced 1,725 in 2001-02?
CREATE TABLE table_4572 ( "Commodity" text, "2001-02" text, "2002-03" text, "2003-04" text, "2004-05" text, "2005-06" text, "2006-07" text )
SELECT "2002-03" FROM table_4572 WHERE "2001-02" = '1,725'
Below are sql tables 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 production in 2002-03 for the commodity that produced 1,725 in 2001-02? ### Input: CREATE TABLE table_4572 ( ...
what were the new prescriptions on the prescription of patient 68280 today compared to the prescription yesterday?
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, ...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 68280) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the new prescriptions on the prescription of patient 68280 today compared to the prescription yesterday? ### Input...
What is the country with a 66-70-69=205 score?
CREATE TABLE table_name_21 ( country VARCHAR, score VARCHAR )
SELECT country FROM table_name_21 WHERE score = 66 - 70 - 69 = 205
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the country with a 66-70-69=205 score? ### Input: CREATE TABLE table_name_21 ( country VARCHAR, score VARCHA...
When the home team score was 21.15 (141), what was the away team?
CREATE TABLE table_10949 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team" FROM table_10949 WHERE "Home team score" = '21.15 (141)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the home team score was 21.15 (141), what was the away team? ### Input: CREATE TABLE table_10949 ( "Home team" text...
how can i get from the DENVER airport to downtown
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 flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE compartmen...
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_code = airport_service.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_name = 'DENVER' AND ground_service.airpor...
Below are sql tables 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 can i get from the DENVER airport to downtown ### Input: CREATE TABLE fare_basis ( fare_basis_code text, booking...
Which week was the October 17, 2004 game played?
CREATE TABLE table_name_76 ( week VARCHAR, date VARCHAR )
SELECT week FROM table_name_76 WHERE date = "october 17, 2004"
Below are sql tables 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 was the October 17, 2004 game played? ### Input: CREATE TABLE table_name_76 ( week VARCHAR, date VARCHAR ...
For those records from the products and each product's manufacturer, return a bar chart about the distribution of headquarter and the average of manufacturer , and group by attribute headquarter, could you list in ascending by the X?
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, AVG(Manufacturer) 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, return a bar chart about the distribution of headquarte...
Who's the writer of the episode seen by 3.25 million people in the US?
CREATE TABLE table_18268826_1 ( written_by VARCHAR, us_viewers__million_ VARCHAR )
SELECT written_by FROM table_18268826_1 WHERE us_viewers__million_ = "3.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's the writer of the episode seen by 3.25 million people in the US? ### Input: CREATE TABLE table_18268826_1 ( writte...
When did an away team score 32.16 (208)?
CREATE TABLE table_57784 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Date" FROM table_57784 WHERE "Away team score" = '32.16 (208)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When did an away team score 32.16 (208)? ### Input: CREATE TABLE table_57784 ( "Home team" text, "Home team score" t...
What is the 2011 value of the paris masters, which had A in 2008, A in 2012, A in 2009?
CREATE TABLE table_name_34 ( tournament VARCHAR )
SELECT 2011 FROM table_name_34 WHERE 2008 = "a" AND 2012 = "a" AND 2009 = "a" AND tournament = "paris masters"
Below are sql tables 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 2011 value of the paris masters, which had A in 2008, A in 2012, A in 2009? ### Input: CREATE TABLE table_name_3...
My Non-Closed Community Wiki Posts. Get a user's Question and Answer that are Community Wiki but not closed. Don't list answers of a Community Wiki Question because they cannot be removed from Community Wiki Status without removing the Question's Community Wiki Status.
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Bod...
SELECT PostTypes.Name, Posts.Id AS "post_link", Posts.Score AS Score, Posts.CreationDate FROM Posts INNER JOIN PostTypes ON Posts.PostTypeId = PostTypes.Id LEFT JOIN Posts AS ParentPosts ON Posts.ParentId = ParentPosts.Id WHERE Posts.PostTypeId IN (1, 2) AND Posts.ClosedDate IS NULL AND ParentPosts.ClosedDate IS NULL 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: My Non-Closed Community Wiki Posts. Get a user's Question and Answer that are Community Wiki but not closed. Don't list an...
what is the maximum age of married patients whose admission year is in or after 2184?
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 MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear >= "2184"
Below are sql tables 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 maximum age of married patients whose admission year is in or after 2184? ### Input: CREATE TABLE diagnoses ( ...
what is the number of patients whose year of birth is less than 2110 and lab test name is asparate aminotransferase (ast)?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2110" AND lab.label = "Asparate Aminotransferase (AST)"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose year of birth is less than 2110 and lab test name is asparate aminotransferase (ast)? #...
Can you tell me what the course prerequisites are for BIOMEDE 523 ?
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course ( c...
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_0.department = 'BIOMEDE' AND COURSE_0.numb...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Can you tell me what the course prerequisites are for BIOMEDE 523 ? ### Input: CREATE TABLE program_course ( program_id ...
Who was the opponent on November 26, 1989?
CREATE TABLE table_33675 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Attendance" real )
SELECT "Opponent" FROM table_33675 WHERE "Date" = 'november 26, 1989'
Below are sql tables 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 on November 26, 1989? ### Input: CREATE TABLE table_33675 ( "Week" real, "Date" text, "Oppo...
What is the venue when the away side scores 11.20 (86)?
CREATE TABLE table_33579 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Venue" FROM table_33579 WHERE "Away team score" = '11.20 (86)'
Below are sql tables 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 venue when the away side scores 11.20 (86)? ### Input: CREATE TABLE table_33579 ( "Home team" text, "Hom...
Top 200 from Chennai, India.
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostHistoryTypes ( Id number, ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%chennai%india%' ORDER BY Reputation DESC LIMIT 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: Top 200 from Chennai, India. ### Input: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description t...
what is the number of patients whose ethnicity is white and diagnoses short title is portal hypertension?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.short_title = "Portal hypertension"
Below are sql tables 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 and diagnoses short title is portal hypertension? ### Input: CREATE ...
What is the average attendance when the opponent is telford tigers?
CREATE TABLE table_name_75 ( attendance INTEGER, opponent VARCHAR )
SELECT AVG(attendance) FROM table_name_75 WHERE opponent = "telford tigers"
Below are sql tables 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 attendance when the opponent is telford tigers? ### Input: CREATE TABLE table_name_75 ( attendance I...
A bar chart shows the distribution of ACC_Road and Team_ID , and group by attribute All_Home, could you list ACC_Road in asc order?
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 ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road
Below are sql tables 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 ACC_Road and Team_ID , and group by attribute All_Home, could you list ACC_Road in asc...
what are the genders of patient 007-7925?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeou...
SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '007-7925'
Below are sql tables 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 genders of patient 007-7925? ### Input: CREATE TABLE microlab ( microlabid number, patientunitstayid nu...
calculate the number of patients who have stayed in the micu careunit during the last year.
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_i...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'micu' AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year'))
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the number of patients who have stayed in the micu careunit during the last year. ### Input: CREATE TABLE outputev...
give me the top three most common diagnoses?
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_tit...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd GROUP BY diagnoses_icd.icd9_code) AS t1 WHERE t1.c1 <= 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: give me the top three most common diagnoses? ### Input: CREATE TABLE procedures_icd ( row_id number, subject_id numb...
give me the number of patients whose admission type is elective and procedure icd9 code is 3613?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "3613"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose admission type is elective and procedure icd9 code is 3613? ### Input: CREATE TABLE lab...
what is the daily minimum amount of tpn that patient 017-59454 took since 2133 days ago?
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE diagnosis ( diagn...
SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-59454')) AND intakeoutput.celllabel = 'tpn' ...
Below are sql tables 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 daily minimum amount of tpn that patient 017-59454 took since 2133 days ago? ### Input: CREATE TABLE vitalperiod...
How many times is the theme roadside attractions: wawa goose?
CREATE TABLE table_25468520_1 ( quantity VARCHAR, theme VARCHAR )
SELECT COUNT(quantity) FROM table_25468520_1 WHERE theme = "Roadside Attractions: Wawa Goose"
Below are sql tables 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 is the theme roadside attractions: wawa goose? ### Input: CREATE TABLE table_25468520_1 ( quantity VARCHA...
Find the subject ID, subject name, and the corresponding number of available courses for each subject.
CREATE TABLE Subjects ( subject_name VARCHAR, subject_id VARCHAR ) CREATE TABLE Courses ( subject_id VARCHAR )
SELECT T1.subject_id, T2.subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_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: Find the subject ID, subject name, and the corresponding number of available courses for each subject. ### Input: CREATE TAB...
If the equation is 6 9 + 6 9 + 6, what is the 2nd throw?
CREATE TABLE table_21443 ( "1st throw" real, "2nd throw" real, "3rd throw" real, "Equation" text, "Result" real )
SELECT MAX("2nd throw") FROM table_21443 WHERE "Equation" = '6 × 9² + 6 × 9 + 6'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the equation is 6 9 + 6 9 + 6, what is the 2nd throw? ### Input: CREATE TABLE table_21443 ( "1st throw" real, "2n...
Which Silver has a Total of 7, and a Gold larger than 1?
CREATE TABLE table_name_10 ( silver INTEGER, total VARCHAR, gold VARCHAR )
SELECT AVG(silver) FROM table_name_10 WHERE total = 7 AND gold > 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 Silver has a Total of 7, and a Gold larger than 1? ### Input: CREATE TABLE table_name_10 ( silver INTEGER, tot...
My 50 Highest Rated Answers On Questions With No Accepted Answer.
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT p.Id AS "post_link", COALESCE(p.LastEditDate, p.CreationDate) AS MostRecentChange, (SELECT COUNT(v.Id) FROM Votes AS v INNER JOIN VoteTypes AS vt ON v.VoteTypeId = vt.Id WHERE vt.Name = 'UpMod' AND v.PostId = p.Id) AS UpVotes, (SELECT COUNT(v.Id) FROM Votes AS v INNER JOIN VoteTypes AS vt ON v.VoteTypeId = vt.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: My 50 Highest Rated Answers On Questions With No Accepted Answer. ### Input: CREATE TABLE Posts ( Id number, PostTyp...
show me the flights from INDIANAPOLIS to MEMPHIS
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufac...
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 = 'INDIANAPOLIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'M...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me the flights from INDIANAPOLIS to MEMPHIS ### Input: CREATE TABLE restriction ( restriction_code text, advanc...
List all customer status codes and the number of customers having each status code in a bar chart, could you rank bar in descending order?
CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50) ) CREATE TABLE Vehicles ( vehicle_id INTEGER, vehicle_details VARCHAR(255) ) CREATE TABLE Lessons ( le...
SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code ORDER BY customer_status_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: List all customer status codes and the number of customers having each status code in a bar chart, could you rank bar in des...