instruction
stringlengths 53
549
| output
stringlengths 30
2.33k
|
---|---|
### Instruction:
when was patient 26612 until 1 year ago admitted for the last time to the hospital?
### Response:
| SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 26612 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY admissions.admittime DESC LIMIT 1 |
### Instruction:
What is Race, when Winning Team is Chip Ganassi Racing, when Pole Position is Ryan Briscoe, and when Most Laps Led is Scott Dixon?
### Response:
| SELECT race FROM table_name_91 WHERE winning_team = "chip ganassi racing" AND pole_position = "ryan briscoe" AND most_laps_led = "scott dixon" |
### 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 department_id , and group by attribute job_id.
### Response:
| SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID |
### Instruction:
Show id and location of railways that are associated with more than one train by a bar chart, and could you display Y-axis from high to low order?
### Response:
| SELECT T1.Location, T1.Railway_ID FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID ORDER BY T1.Railway_ID DESC |
### Instruction:
Which Copa Libertadores 1992 has a Supercopa Sudamericana 1992 of round of 16, and a Team of gr mio?
### Response:
| SELECT copa_libertadores_1992 FROM table_name_59 WHERE supercopa_sudamericana_1992 = "round of 16" AND team = "grêmio" |
### Instruction:
How many patients who had a thoracentesis procedure were admitted to the hospital before 2180?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2180" AND procedures.short_title = "Thoracentesis" |
### Instruction:
For those employees who was hired before 2002-06-21, show me about the distribution of hire_date and the amount of hire_date bin hire_date by weekday in a bar chart.
### Response:
| SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE HIRE_DATE < '2002-06-21' |
### Instruction:
What is the sum of the capacities for Carrigh wind warm that has a size of 0.85 MW and more than 3 turbines?
### Response:
| SELECT SUM("Capacity (MW)") FROM table_39539 WHERE "Size (MW)" = '0.85' AND "Wind Farm" = 'carrigh' AND "Turbines" > '3' |
### Instruction:
What is the lowest played when draws P.K. Wins / P.K. Losses is 3/0, and points is larger than 18?
### Response:
| SELECT MIN("Played") FROM table_63943 WHERE "Draws P.K. Wins / P.K. Losses" = '3/0' AND "Points" > '18' |
### Instruction:
Show the names of employees that work for companies with sales bigger than 200.
### Response:
| SELECT T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID WHERE T3.Sales_in_Billion > 200 |
### Instruction:
provide the number of patients whose age is less than 45 and procedure long title is open biopsy of liver?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "45" AND procedures.long_title = "Open biopsy of liver" |
### Instruction:
Name the condition for partial thromboplastin time of prolonged and platelet count of unaffected with bleeding time of prolonged
### Response:
| SELECT "Condition" FROM table_70995 WHERE "Partial thromboplastin time" = 'prolonged' AND "Platelet count" = 'unaffected' AND "Bleeding time" = 'prolonged' |
### Instruction:
Which Week has Points For larger than 19, and an Opponent of philadelphia eagles, and Points Against larger than 7?
### Response:
| SELECT MAX("Week") FROM table_41396 WHERE "Points For" > '19' AND "Opponent" = 'philadelphia eagles' AND "Points Against" > '7' |
### Instruction:
What is the highest Rank, when Date of Official Foundation of Municipality is '1952', and when 2006 is less than 189120?
### Response:
| SELECT MAX("Rank") FROM table_44171 WHERE "Date of Official Foundation of Municipality" = '1952' AND "2006" < '189120' |
### Instruction:
Which Schwaben has a Oberbayern of fc bayern munich ii and a Mittelfranken of 1. fc nuremberg ii?
### Response:
| SELECT "Schwaben" FROM table_36742 WHERE "Oberbayern" = 'fc bayern munich ii' AND "Mittelfranken" = '1. fc nuremberg ii' |
### Instruction:
All of the PreMajor classes are ?
### Response:
| SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id |
### Instruction:
What is Type, when Rank is greater than 6, when Number of Bearers 2008 is greater than 13.815, and when Surname is Eriksen?
### Response:
| SELECT type FROM table_name_47 WHERE rank > 6 AND number_of_bearers_2008 > 13.815 AND surname = "eriksen" |
### Instruction:
WHAT IS THE PM THAT HAS NO BLOGS, NO XML Forms Management and workflow, NO SEARCH, AND NO SOCIAL SOFTWARE?
### Response:
| SELECT project_management FROM table_name_9 WHERE blogs = "no" AND xml_forms_management_and_workflow = "no" AND enterprise_search = "no" AND social_software = "no" |
### Instruction:
what is the highest gnis feature id# link a[ ] b[ ] when the name a[ ] is upper dewey lake dam?
### Response:
| SELECT MAX("GNIS Feature ID # Link A[\u203a ] B[\u203a ]") FROM table_14299 WHERE "Name A[\u203a ]" = 'upper dewey lake dam' |
### Instruction:
Which Name has a Tonnage (GRT) larger than 4,071, and a Nationality of united kingdom, and a Fate of damaged?
### Response:
| SELECT "Name" FROM table_9861 WHERE "Tonnage (GRT)" > '4,071' AND "Nationality" = 'united kingdom' AND "Fate" = 'damaged' |
### Instruction:
Post Count by Tag specified with HAVING TagName IN (...).
### Response:
| SELECT COUNT(*), T.TagName FROM Posts AS P INNER JOIN PostTags AS PT ON (P.Id = PT.PostId) INNER JOIN Tags AS T ON (PT.TagId = T.Id) GROUP BY T.TagName HAVING t.TagName IN ('powershell', 'bash') ORDER BY COUNT(*) DESC |
### Instruction:
For those employees who did not have any job in the past, find hire_date and the average of employee_id bin hire_date by time, and visualize them by a bar chart.
### Response:
| SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) |
### Instruction:
What is teh average amount of goals for club real avil s cf, which has more than 59 goals against and a -10 goal difference?
### Response:
| SELECT AVG("Goals for") FROM table_7862 WHERE "Goals against" > '59' AND "Club" = 'real avilés cf' AND "Goal Difference" > '-10' |
### Instruction:
For those employees who did not have any job in the past, return a line chart about the change of salary over hire_date , and I want to sort by the X-axis in ascending.
### Response:
| SELECT HIRE_DATE, SALARY FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE |
### Instruction:
Give me a histogram for which parts have more than 2 faults? Show the part name and id, and rank X-axis from low to high order please.
### Response:
| SELECT T1.part_name, T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id ORDER BY T1.part_name |
### Instruction:
For those records from the products and each product's manufacturer, a bar chart shows the distribution of founder and the sum of price , and group by attribute founder, and order by the x-axis in asc.
### Response:
| SELECT Founder, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder |
### Instruction:
count the number of patients whose death status is 1 and diagnoses short title is dermatitis nos?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Dermatitis NOS" |
### Instruction:
Closed questions with reasons, sorted by date.
### Response:
| SELECT p.Id AS "post_link", ph.CreationDate AS "closure_date", ph.Comment AS "close_reason", ph.Text AS Voters FROM PostHistory AS ph INNER JOIN Posts AS p ON p.Id = ph.PostId WHERE ph.PostHistoryTypeId = 10 ORDER BY ph.CreationDate DESC |
### Instruction:
give me the number of patients whose year of birth is less than 2041 and drug route is sc?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2041" AND prescriptions.route = "SC" |
### Instruction:
provide the number of patients whose year of birth is less than 2043 and lab test fluid is other body fluid?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2043" AND lab.fluid = "Other Body Fluid" |
### Instruction:
What is the Place of the Player with Money greater than 300 and a Score of 71-69-70-70=280?
### Response:
| SELECT "Place" FROM table_76985 WHERE "Money ( $ )" > '300' AND "Score" = '71-69-70-70=280' |
### Instruction:
How many times is the award ceremony laurence olivier award, result is won and the nominee is imelda staunton?
### Response:
| SELECT COUNT("Year") FROM table_62311 WHERE "Award Ceremony" = 'laurence olivier award' AND "Result" = 'won' AND "Nominee" = 'imelda staunton' |
### Instruction:
count the number of patients who are male and their diagnoses icd9 code is 28521.
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.icd9_code = "28521" |
### Instruction:
What is the lowest 2008 when the 2009 was 7,006, and a 2006 larger than 4,844?
### Response:
| SELECT MIN("2008") FROM table_7097 WHERE "2009" = '7,006' AND "2006" > '4,844' |
### Instruction:
What is the average salary for each job title Show bar chart, and show y-axis in desc order please.
### Response:
| SELECT JOB_TITLE, AVG(SALARY) FROM employees AS T1 JOIN jobs AS T2 ON T1.JOB_ID = T2.JOB_ID GROUP BY T2.JOB_TITLE ORDER BY AVG(SALARY) DESC |
### Instruction:
What is the Mach with Vehicle Flight # m2-f2 #8 and an Altitude (meters) greater than 13,716?
### Response:
| SELECT SUM("Mach") FROM table_80137 WHERE "Vehicle Flight #" = 'm2-f2 #8' AND "Altitude (meters)" > '13,716' |
### Instruction:
What year was the game at the Los Angeles Memorial Coliseum, with attendance more than 85,302, on November 9?
### Response:
| SELECT "Year" FROM table_12591 WHERE "Venue" = 'los angeles memorial coliseum' AND "Attendance" > '85,302' AND "Date" = 'november 9' |
### Instruction:
What is listed as the average Date that has U-boats destroyed (KuK) of 2 with Tonnage of 1,514,050?
### Response:
| SELECT AVG("Date") FROM table_13831 WHERE "U-boats destroyed (KuK)" = '2' AND "Tonnage" = '1,514,050' |
### Instruction:
how many patients stayed in hospital for more than 17 days and tested for fibrinogen, functional in lab?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "17" AND lab.label = "Fibrinogen, Functional" |
### Instruction:
Show the names and heights of buildings with at least two institutions founded after 1880.
### Response:
| SELECT T1.name, T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded > 1880 GROUP BY T1.building_id HAVING COUNT(*) >= 2 |
### Instruction:
What are the total number of patients who stayed in the hospital for more than 2 days and their lab test name is calcium?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "2" AND lab.label = "Calcium, Total" |
### Instruction:
What is the lowest U Wins, when Alianza Wins is greater than 0, when Alianza Goals is greater than 25, and when Draws is '99'?
### Response:
| SELECT MIN(u_wins) FROM table_name_52 WHERE alianza_wins > 0 AND alianza_goals > 25 AND draws = 99 |
### Instruction:
find the number of widow patients who had insertion of 2 vascular stents.
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.short_title = "Insert 2 vascular stents" |
### Instruction:
What is the average Year during which the Driver Adrian Quaife-Hobbs has fewer than 2 Poles, and 0 Fast laps?
### Response:
| SELECT AVG("Year") FROM table_42968 WHERE "Poles" < '2' AND "Fast laps" = '0' AND "Drivers" = 'adrian quaife-hobbs' |
### Instruction:
For all employees who have the letters D or S in their first name, give me the trend about department_id over hire_date , could you show in descending by the x-axis please?
### Response:
| SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC |
### Instruction:
What is Set 2, when Score is 3-0, when Date is May 11, and when Set 1 is 25-20?
### Response:
| SELECT "Set 2" FROM table_40499 WHERE "Score" = '3-0' AND "Date" = 'may 11' AND "Set 1" = '25-20' |
### Instruction:
Give the name of each department and the number of employees in each in a bar chart, and could you sort by the y-axis from high to low?
### Response:
| SELECT DEPARTMENT_NAME, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID GROUP BY T2.DEPARTMENT_NAME ORDER BY COUNT(*) DESC |
### Instruction:
out of total number of patients with item id 51288, how many of them were married?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.itemid = "51288" |
### Instruction:
What was the total amount of Value ($M), when the Country was Spain, the Rank was 19, and the Debt as % of value was larger than 159?
### Response:
| SELECT COUNT(value__) AS $m_ FROM table_name_54 WHERE country = "spain" AND rank = 19 AND debt_as__percentageof_value > 159 |
### Instruction:
give me the number of patients whose language is engl and procedure long title is infusion of vasopressor agent?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.language = "ENGL" AND procedures.long_title = "Infusion of vasopressor agent" |
### Instruction:
What is the number of each course name that have at least five enrollments? Show me a bar chart.
### Response:
| SELECT T1.CName, COUNT(T1.CName) FROM Course AS T1 JOIN Enrolled_in AS T2 ON T1.CID = T2.CID GROUP BY T1.CName, T2.CID HAVING COUNT(*) >= 5 |
### Instruction:
which channel will have play by play commentator Paul Sunderland, Studio Host Bill Macdonald and Studi Analysty Jack Haley?
### Response:
| SELECT "Channel" FROM table_45378 WHERE "Play-by-play" = 'paul sunderland' AND "Studio host" = 'bill macdonald' AND "Studio analysts" = 'jack haley' |
### Instruction:
What is the 1994 value with a 2r in 1996, A in 1993, and 2r in 1991?
### Response:
| SELECT 1994 FROM table_name_42 WHERE 1996 = "2r" AND 1993 = "a" AND 1991 = "2r" |
### Instruction:
how many patients underwent the procedure titled closed (percutaneous)[needle] biopsy of liver?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Closed (percutaneous) [needle] biopsy of liver" |
### Instruction:
count the number of inpatient hospital admission patients who had magnesium lab test.
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND lab.label = "Magnesium" |
### Instruction:
provide the number of patients whose ethnicity is unknown/not specified and primary disease is morbid obesity/sda?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "UNKNOWN/NOT SPECIFIED" AND demographic.diagnosis = "MORBID OBESITY/SDA" |
### Instruction:
how many patients whose death status is 0 and drug name is hydroxyzine hcl?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "0" AND prescriptions.drug = "Hydroxyzine HCl" |
### Instruction:
Name the state with an evening gown more than 8.86 and interview less than 8.7 and swimsuit less than 8.96
### Response:
| SELECT "State" FROM table_78218 WHERE "Evening Gown" > '8.86' AND "Swimsuit" < '8.96' AND "Interview" < '8.7' |
### Instruction:
What is the difficulty level for all of the CS-LSA courses ?
### Response:
| SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course, program, program_course WHERE program_course.course_id = course.course_id AND program.name LIKE 'CS-LSA' AND program.program_id = program_course.program_id |
### Instruction:
Count the number of urgent hospital admission patients who have a prescription for milrinone.
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug = "Milrinone" |
### Instruction:
give me the number of patients whose marital status is married and item id is 51438?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.itemid = "51438" |
### Instruction:
how did patient 18757 go into the hospital the first time until 1 year ago.
### Response:
| SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 18757 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY admissions.admittime LIMIT 1 |
### Instruction:
how many patients are diagnosed with primary disease liver transplant and suggested with drug route po?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND prescriptions.route = "PO" |
### Instruction:
what is the score when the outcome is runner-up, the opponent in the final is herbert lawford and the year is after 1882?
### Response:
| SELECT "Score" FROM table_51305 WHERE "Year" > '1882' AND "Outcome" = 'runner-up' AND "Opponent in the final" = 'herbert lawford' |
### Instruction:
(Possibly) suspended users with Supporter badge.
### Response:
| SELECT u.CreationDate, u.Id AS "user_link" FROM Users AS u INNER JOIN Badges AS b ON b.UserId = u.Id WHERE b.Name = 'Nice Question' AND u.Reputation <= 1 GROUP BY u.Id, u.CreationDate ORDER BY u.CreationDate |
### Instruction:
What is Player, when To Par is '+1', when Country is 'United States', and when Score is '71-70=141'?
### Response:
| SELECT "Player" FROM table_43880 WHERE "To par" = '+1' AND "Country" = 'united states' AND "Score" = '71-70=141' |
### Instruction:
Top 10 users in Coimbatore.
### Response:
| SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%coimbatore%' OR UPPER(Location) LIKE '%COIMBATORE%' OR Location LIKE '%Karur%' ORDER BY Reputation DESC LIMIT 10 |
### Instruction:
What is Original title, when Director is Veljko Bulaji category:articles with hcards, and when Film title used in nomination is Train Without A Timetable?
### Response:
| SELECT original_title FROM table_name_35 WHERE director = "veljko bulajić category:articles with hcards" AND film_title_used_in_nomination = "train without a timetable" |
### Instruction:
What district has counties represented by Baltimore county, a committee of health and government operations, and a first elected smaller than 2002?
### Response:
| SELECT "District" FROM table_15822 WHERE "Counties Represented" = 'baltimore county' AND "Committee" = 'health and government operations' AND "First Elected" < '2002' |
### Instruction:
For those employees who did not have any job in the past, give me the trend about department_id over hire_date , display in ascending by the HIRE_DATE.
### Response:
| SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE |
### Instruction:
Which label has a year older than 2004 and a 2xcd detail as well as the sonic seducer cold hands seduction vol. 69 title?
### Response:
| SELECT label FROM table_name_88 WHERE year > 2004 AND details = "2xcd" AND title = "sonic seducer cold hands seduction vol. 69" |
### Instruction:
count the number of patients whose gender is m and diagnoses long title is injury to femoral nerve?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Injury to femoral nerve" |
### Instruction:
Top SO from seoul, south korea.
### Response:
| SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%seoul%' OR UPPER(Location) LIKE '%SEOUL%' OR Location LIKE '%Seoul%' AND Reputation >= 1000 ORDER BY Reputation DESC |
### Instruction:
what is the number of government health insurance patients who had suture bladder laceration procedure?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Suture bladder lacerat" |
### Instruction:
Visualize a bar chart for what are the first names and ids for customers who have two or more accounts?, and order from high to low by the bars.
### Response:
| SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.customer_first_name DESC |
### Instruction:
Name the total number of NGC number for sagittarius and diffuse nebula with declination of 02
### Response:
| SELECT COUNT("NGC number") FROM table_10401 WHERE "Constellation" = 'sagittarius' AND "Object type" = 'diffuse nebula' AND "Declination ( J2000 )" = '°02′' |
### Instruction:
how many patients whose days of hospital stay is greater than 5 and drug type is additive?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "5" AND prescriptions.drug_type = "ADDITIVE" |
### Instruction:
Get me the number of patients admitted before the year 2158 who had a theophylline lab test.
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2158" AND lab.label = "Theophylline" |
### Instruction:
Who are the nominees who were nominated for either of the Bob Fosse or Cleavant Derricks awards, and count them by a bar chart, display x-axis in desc order.
### Response:
| SELECT Nominee, COUNT(Nominee) FROM musical WHERE Award = "Tony Award" OR Award = "Cleavant Derricks" GROUP BY Nominee ORDER BY Nominee DESC |
### Instruction:
Find the 'date became customers' of the customers whose ID is between 10 and 20, and count them by a bar chart, and show Y-axis in asc order.
### Response:
| SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 ORDER BY COUNT(date_became_customer) |
### Instruction:
What year were the election results tom loeffler (r) 80.6% joe sullivan (d) 19.4%?
### Response:
| SELECT MIN(first_elected) FROM table_1341598_44 WHERE candidates = "Tom Loeffler (R) 80.6% Joe Sullivan (D) 19.4%" |
### Instruction:
What is the 2009 for 2012 1R in Wimbledon and a 2011 2r?
### Response:
| SELECT "2009" FROM table_12790 WHERE "2012" = '1r' AND "Tournament" = 'wimbledon' AND "2011" = '2r' |
### Instruction:
How many patients of hispanic or latino ethnicity are procedured with ptca?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND procedures.short_title = "PTCA" |
### Instruction:
What is the latitude with a GEO ID larger than 3806352640, and a Land(sqmi) of 34.345?
### Response:
| SELECT AVG(latitude) FROM table_name_98 WHERE geo_id > 3806352640 AND land___sqmi__ = 34.345 |
### Instruction:
What is the sum of Year with a Type of informal, and a Location with justus lipsius building, brussels, and a Date with 23 may?
### Response:
| SELECT SUM("Year") FROM table_54598 WHERE "Type" = 'informal' AND "Location" = 'justus lipsius building, brussels' AND "Date" = '23 may' |
### Instruction:
how many patients born before the year 2146 had lab test item id 51067?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2146" AND lab.itemid = "51067" |
### Instruction:
what is the number of patients whose admission type is elective and item id is 51265?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.itemid = "51265" |
### Instruction:
For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by time.
### Response:
| SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) |
### Instruction:
give me the number of patients whose age is less than 55 and lab test name is immunoglobulin g?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "55" AND lab.label = "Immunoglobulin G" |
### Instruction:
For those employees who did not have any job in the past, find hire_date and the average of manager_id bin hire_date by weekday, and visualize them by a bar chart.
### Response:
| SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) |
### Instruction:
What shows for sat 20 aug when fri 26 aug is 19' 30.70 116.023mph?
### Response:
| SELECT sat_20_aug FROM table_30058355_2 WHERE fri_26_aug = "19' 30.70 116.023mph" |
### Instruction:
What's the total number of NGC that has a Declination ( J2000 ) of 15 55 , and an Apparent magnitude greater than 10?
### Response:
| SELECT SUM(ngc_number) FROM table_name_28 WHERE declination___j2000__ = "°15′55″" AND apparent_magnitude > 10 |
### Instruction:
What is the mean amount of staying councilors with an election result amounting to less than 10 with the Green party, and a new council bigger than 0?
### Response:
| SELECT AVG("Staying councillors") FROM table_10295 WHERE "Election result" < '10' AND "Party" = 'green' AND "New council" > '0' |
### Instruction:
What percentage is listed in column r1b1a2 (r-m269) for the 77.8% r1b1c (r-v88)?
### Response:
| SELECT "R1b1a2 (R-M269)" FROM table_73302 WHERE "R1b1c (R-V88)" = '77.8%' |
### Instruction:
the number of patients in ward 23 since 2103?
### Response:
| SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 23 AND STRFTIME('%y', transfers.intime) >= '2103') |
### Instruction:
What is the sum of the cereals of the governorate with 20,753 vegetables and less than 123,304 fruit trees?
### Response:
| SELECT SUM("Cereals") FROM table_12851 WHERE "Vegetables" = '20,753' AND "Fruit Trees" < '123,304' |
### Instruction:
Most viseted post for each user.
### Response:
| SELECT Users.DisplayName, Posts.Title, Posts.ViewCount FROM Users INNER JOIN Posts ON Posts.OwnerUserId = Users.Id WHERE Posts.ViewCount = (SELECT MAX(p.ViewCount) FROM Posts AS p WHERE p.OwnerUserId = Users.Id GROUP BY p.OwnerUserId) ORDER BY ViewCount |
### Instruction:
If the San Antonio de Lomerio municipality percentage is 5.480, what is the total percentage for the San Julian municipality?
### Response:
| SELECT COUNT(san_julián_municipality___percentage_) FROM table_19998428_3 WHERE san_antonio_de_lomerío_municipality___percentage_ = "5.480" |
### Instruction:
Which Club has a League Cup goals of 0, and a FA Cup goals of 1, and a Total larger than 11, and a League goals of 13?
### Response:
| SELECT club FROM table_name_99 WHERE league_cup_goals = "0" AND fa_cup_goals = "1" AND total > 11 AND league_goals = "13" |
### Instruction:
what is the number of patients whose days of hospital stay is greater than 6 and drug type is main?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "6" AND prescriptions.drug_type = "MAIN" |
Subsets and Splits