instruction
stringlengths 53
549
| output
stringlengths 30
2.33k
|
---|---|
### Instruction:
Users with 10 or more meta posts with score of 2 or more (Convention badge).
### Response:
| SELECT u.Id AS "user_link", COUNT(*) AS NumPosts FROM Posts AS p INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE p.Score >= 2 GROUP BY u.Id HAVING COUNT(*) >= 10 ORDER BY NumPosts DESC |
### Instruction:
provide the number of patients admitted before 2119 who were diagnosed with septic shock.
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2119" AND diagnoses.short_title = "Septic shock" |
### Instruction:
how did patient 76327 enter the hospital since 6 years ago for the first time?
### Response:
| SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 76327 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-6 year') ORDER BY admissions.admittime LIMIT 1 |
### Instruction:
What is Choreographer(s), when Chosen By is Mary Murphy, and when Couple is Katee Shean Stephen 'Twitch' Boss?
### Response:
| SELECT "Choreographer(s)" FROM table_6859 WHERE "Chosen by" = 'mary murphy' AND "Couple" = 'katee shean stephen "twitch" boss' |
### Instruction:
how many more people live in dennery than the forest reserve ?
### Response:
| SELECT (SELECT "population\n(2010 census)" FROM table_203_212 WHERE "district" = 'dennery') - (SELECT "population\n(2010 census)" FROM table_203_212 WHERE "district" = 'forest reserve') |
### Instruction:
of the municipalities with positive population growth in the years 2006-2011 , which had the least growth ?
### Response:
| SELECT "census subdivision" FROM table_203_834 WHERE "change in % 2006-2011" > 0 ORDER BY "change in % 2006-2011" LIMIT 1 |
### Instruction:
On what date is the winning team Abt Sportsline and pole position Mattias Ekstr m in the Circuit Ricardo Tormo , Valencia?
### Response:
| SELECT date FROM table_26267607_2 WHERE winning_team = "Abt Sportsline" AND pole_position = "Mattias Ekström" AND circuit = "circuit Ricardo Tormo , Valencia" |
### Instruction:
count the number of patients whose death status is 0 and procedure icd9 code is 3734?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "3734" |
### Instruction:
What is the district for the party federalist and the candidates are william craik (f) 51.0% benjamin edwards 49.0%?
### Response:
| SELECT district FROM table_2668416_7 WHERE party = "Federalist" AND candidates = "William Craik (F) 51.0% Benjamin Edwards 49.0%" |
### Instruction:
For those employees who did not have any job in the past, give me the comparison about the average of department_id over the job_id , and group by attribute job_id.
### Response:
| SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID |
### Instruction:
What's the 2001 census of the region of Abruzzo where the 1871 census is bigger than 51092.0?
### Response:
| SELECT MIN("2001 Census") FROM table_15975 WHERE "Region" = 'Abruzzo' AND "1981 Census" > '51092.0' |
### Instruction:
count the number of patients who were born before the year 2182 whose lab test fluid is joint fluid.
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2182" AND lab.fluid = "Joint Fluid" |
### Instruction:
provide the number of patients whose gender is m and diagnoses icd9 code is 5856?
### 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 = "5856" |
### Instruction:
what is mon 23 aug when fri 27 aug is 18' 59.25 119.226mph?
### Response:
| SELECT mon_23_aug FROM table_26986076_2 WHERE fri_27_aug = "18' 59.25 119.226mph" |
### Instruction:
Show the names of countries and the average speed of roller coasters from each country with a bar chart, sort in asc by the bars.
### Response:
| SELECT T1.Name, AVG(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name ORDER BY T1.Name |
### Instruction:
give me the number of patients less than 61 years who have procedure icd9 code 3727.
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "61" AND procedures.icd9_code = "3727" |
### Instruction:
How many movies did ' Quentin Tarantino ' direct after 2010 ?
### Response:
| SELECT COUNT(DISTINCT (movie.title)) FROM directed_by, director, movie WHERE director.did = directed_by.did AND director.name = 'Quentin Tarantino' AND movie.mid = directed_by.msid AND movie.release_year > 2010 |
### Instruction:
give me the number of patients whose discharge location is snf and lab test name is bilirubin?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "SNF" AND lab.label = "Bilirubin" |
### Instruction:
For the problem whose id is 10, bin the log_entry_date into the weekday interval and count the date, and return a bar chart, and I want to list by the Y-axis in ascending.
### Response:
| SELECT log_entry_date, COUNT(log_entry_date) FROM Problem_Log WHERE problem_id = 10 ORDER BY COUNT(log_entry_date) |
### Instruction:
count the number of patients whose admission type is urgent and item id is 50801?
### Response:
| 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.itemid = "50801" |
### Instruction:
Who won the mixed restricted when Tomasz Rzeszotko won the mixed veteran and Karina Le Fevre won the U21 womens?
### Response:
| SELECT mixed_restricted FROM table_28211674_3 WHERE mixed_veteran = "Tomasz Rzeszotko" AND u21_womens = "Karina Le Fevre" |
### Instruction:
Who won Miss Air (1st Runner-up) when Catherine Untalan was Miss Water (2nd Runner-up) earlier than 2007?
### Response:
| SELECT miss_air__1st_runner_up_ FROM table_name_35 WHERE year < 2007 AND miss_water__2nd_runner_up_ = "catherine untalan" |
### Instruction:
what is the number of patients whose admission year is less than 2182 and lab test name is c4?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2182" AND lab.label = "C4" |
### Instruction:
A pie chart for returning the number of the lot details of lots that belong to investors with details 'l'?
### Response:
| SELECT lot_details, COUNT(lot_details) FROM Investors AS T1 JOIN Lots AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = "l" GROUP BY lot_details |
### Instruction:
Tags sorted by your average post reputation.
### Response:
| SELECT TagName, CAST(SUM(Posts.Score) AS FLOAT) / COUNT(*) AS Reputation FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId GROUP BY TagName HAVING COUNT(*) > 5000 ORDER BY Reputation |
### Instruction:
How many documents are created in each day? Bin the document date by weekday with a bar chart, and could you list y axis in desc order?
### Response:
| SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code ORDER BY COUNT(Document_Date) DESC |
### Instruction:
How many laps did the rider with a grid larger than 11, a Honda cbr1000rr bike, and a time of +42.633?
### Response:
| SELECT laps FROM table_name_17 WHERE grid > 11 AND bike = "honda cbr1000rr" AND time = "+42.633" |
### Instruction:
Get Posts with at least three answers.
### Response:
| SELECT ROW_NUMBER() OVER (ORDER BY Id DESC), * FROM Posts AS a WHERE a.AnswerCount >= 3 AND a.PostTypeId = 1 AND a.OwnerUserId NOT IN (SELECT OwnerUserId FROM Posts AS p WHERE p.PostTypeId = 2 AND p.ParentId = a.Id) |
### Instruction:
What is the density of an area that is 1.38km and has a population more than 12924?
### Response:
| SELECT COUNT("Density (people/km 2 )") FROM table_74714 WHERE "Area (km 2 )" > '1.38' AND "Population (2012)" > '12924' |
### Instruction:
How many circuits had a winning team of #1 patr n highcroft racing ang gtc winning team #81 alex job racing ?
### Response:
| SELECT COUNT(circuit) FROM table_24037660_2 WHERE lmp_winning_team = "#1 Patrón Highcroft Racing" AND gtc_winning_team = "#81 Alex Job Racing" |
### Instruction:
How many races are held in each year after 2014? Show me a bar chart, and sort from low to high by the the number of year please.
### Response:
| SELECT year, COUNT(year) FROM races AS T1 JOIN results AS T2 ON T1.raceId = T2.raceId WHERE T1.year > 2014 GROUP BY year ORDER BY COUNT(year) |
### Instruction:
miracle man and kanjyuro matsuyama both won the title in which japanese city ?
### Response:
| SELECT "location" FROM table_204_854 WHERE "wrestlers" = 'miracle man' INTERSECT SELECT "location" FROM table_204_854 WHERE "wrestlers" = 'kanjyuro matsuyama' |
### Instruction:
What's the sum of WIns with Draws that's larger than 1, Losses that's smaller than 4, and Conceded of 20?
### Response:
| SELECT SUM("Wins") FROM table_39042 WHERE "Draws" > '1' AND "Losses" < '4' AND "Conceded" = '20' |
### Instruction:
How many members of club 'Bootup Baltimore' are younger than 18?
### Response:
| SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.age < 18 |
### Instruction:
Find the description and code of the service type that is performed the most times.
### Response:
| SELECT T1.service_type_description, T1.service_type_code FROM ref_service_types AS T1 JOIN services AS T2 ON T1.service_type_code = T2.service_type_code GROUP BY T1.service_type_code ORDER BY COUNT(*) DESC LIMIT 1 |
### Instruction:
how many patients born before the year 2098 had drug route as dialys?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2098" AND prescriptions.route = "DIALYS" |
### Instruction:
WHich Losing Team has a Venue of sydney football stadium, and a Total larger than 80, and a Winning Team of tigers?
### Response:
| SELECT "Losing Team" FROM table_7895 WHERE "Venue" = 'sydney football stadium' AND "Total" > '80' AND "Winning Team" = 'tigers' |
### Instruction:
count the number of patients whose days of hospital stay is greater than 3 and lab test category is hematology?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "3" AND lab."CATEGORY" = "Hematology" |
### Instruction:
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id.
### Response:
| SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID |
### Instruction:
how many patients whose discharge location is home health care and lab test name is amylase?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND lab.label = "Amylase" |
### Instruction:
how many patients admitted before 2162 had lab test item id 50803?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2162" AND lab.itemid = "50803" |
### Instruction:
Number of comments on each user's posts.
### Response:
| SELECT Users.DisplayName, COUNT(Posts.Id) AS number_of_posts, SUM(CommentCount) * 1.0 / COUNT(Posts.Id) AS number_of_comments_per_post FROM Users INNER JOIN Posts ON Posts.OwnerUserId = Users.Id GROUP BY DisplayName ORDER BY 2 DESC |
### Instruction:
count the number of patients who were born before the year 2056 and the lab test fluid is urine.
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2056" AND lab.fluid = "Urine" |
### Instruction:
how many patients had coronary arteriogram nec on urgent admission?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Coronary arteriogram NEC" |
### Instruction:
what townships have the same water area as lake township ?
### Response:
| SELECT "township" FROM table_204_322 WHERE "township" <> 'lake' AND "water area\nkm2 (sq mi)" = (SELECT "water area\nkm2 (sq mi)" FROM table_204_322 WHERE "township" = 'lake') |
### Instruction:
How many black/haitian patients have a thiamine prescription?
### Response:
| 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 = "Thiamine" |
### Instruction:
What is the highest number of nominations by Taoiseach of the composition with an administrative panel greater than 0 and an industrial and commercial panel less than 1?
### Response:
| SELECT MAX("Nominated by the Taoiseach") FROM table_75499 WHERE "Administrative Panel" > '0' AND "Industrial and Commercial Panel" < '1' |
### Instruction:
When the Makeup is u s s and the Spin (Parity) J P of 3 2 +, what is the Rest mass MeV/C2?
### Response:
| SELECT "Rest mass MeV / c 2" FROM table_56574 WHERE "Makeup" = 'u s s' AND "Spin ( Parity ) J P" = '3⁄2 +' |
### Instruction:
What are the details for the project whose research has been published?
### Response:
| SELECT T1.project_details FROM projects AS T1 JOIN project_outcomes AS T2 ON T1.project_id = T2.project_id JOIN research_outcomes AS T3 ON T2.outcome_code = T3.outcome_code WHERE T3.outcome_description LIKE '%Published%' |
### Instruction:
had patient 1417 undergone any lab tests in the first hospital visit?
### Response:
| SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1417 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) |
### Instruction:
which team had the same amount of total points as c.d. altetico balboa ?
### Response:
| SELECT "team" FROM table_203_30 WHERE "points" = (SELECT "points" FROM table_203_30 WHERE "team" = 'c.d. atletico balboa') AND "team" <> 'c.d. atletico balboa' |
### Instruction:
did belfast royal academy have more or less total finals than ballyclare high school ?
### Response:
| SELECT (SELECT "total finals" FROM table_203_362 WHERE "school" = 'belfast royal academy') > (SELECT "total finals" FROM table_203_362 WHERE "school" = 'ballyclare high school') |
### Instruction:
how many prescriptions have been ordered for oxycodone-acetaminophen elixir until 3 years ago?
### Response:
| SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'oxycodone-acetaminophen elixir' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 year') |
### Instruction:
what is the maximum round for gt3 winner hector lester tim mullen and pole position of jonny cocker paul drayson
### Response:
| SELECT MAX(round) FROM table_13079788_3 WHERE gt3_winner = "Hector Lester Tim Mullen" AND pole_position = "Jonny Cocker Paul Drayson" |
### Instruction:
give me the number of patients whose insurance is private and procedure short title is int inser lead atri-vent?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Int inser lead atri-vent" |
### Instruction:
When the Track is ESO, the peak is smaller than 25, and the year is larger than 2004, what is the total number of Weeks on Chart?
### Response:
| SELECT COUNT("Weeks on Chart") FROM table_40733 WHERE "Track" = 'eso' AND "Peak" < '25' AND "Year" > '2004' |
### Instruction:
What is the highest Capacity that has 13.14% Annual change and Total Passengers larger than 15,499,462?
### Response:
| SELECT MAX("Capacity") FROM table_42922 WHERE "Annual change" = '13.14%' AND "Total Passengers" > '15,499,462' |
### Instruction:
What is the id and detail of the vehicle used in lessons for most of the times?
### Response:
| SELECT T1.vehicle_id, T1.vehicle_details FROM vehicles AS T1 JOIN lessons AS T2 ON T1.vehicle_id = T2.vehicle_id GROUP BY T1.vehicle_id ORDER BY COUNT(*) DESC LIMIT 1 |
### Instruction:
Find the number of courses offered by Psychology department in each building with a bar chart, could you list in ascending by the total number?
### Response:
| SELECT building, COUNT(building) FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' GROUP BY building ORDER BY COUNT(building) |
### Instruction:
Which Blagojevich (D) has a Source of zogby/wsj, and a Date of october 16, 2006?
### Response:
| SELECT "Blagojevich (D)" FROM table_75304 WHERE "Source" = 'zogby/wsj' AND "Date" = 'october 16, 2006' |
### Instruction:
What is the poll source when Jeff Sessions is at 58% and the date administered is July 31, 2008?
### Response:
| SELECT "Poll Source" FROM table_49513 WHERE "Republican: Jeff Sessions" = '58%' AND "Dates administered" = 'july 31, 2008' |
### Instruction:
Give me a bar chart showing the number of products supplied by supplier id 3 for different product type code.
### Response:
| SELECT product_type_code, COUNT(product_type_code) FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 GROUP BY product_type_code |
### Instruction:
What is the date of the match with a result of ud 12/12 between Pernell Whitaker and James Mcgirt?
### Response:
| SELECT "Date" FROM table_69456 WHERE "Result" = 'ud 12/12' AND "Name" = 'pernell whitaker' AND "Opponent" = 'james mcgirt' |
### Instruction:
how many times was patient 016-14568 until 2104 in the hospital?
### Response:
| SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '016-14568' AND STRFTIME('%y', patient.hospitaladmittime) <= '2104' |
### Instruction:
Currently open questions with 'possible duplicate' comments..
### Response:
| SELECT Comments.PostId AS "post_link", COUNT(*) AS "duplicate_count" FROM Comments WHERE Comments.Text LIKE 'possible duplicate of%' AND (SELECT Posts.ClosedDate FROM Posts WHERE Id = Comments.PostId) IS NULL GROUP BY Comments.PostId ORDER BY 'duplicate_count' DESC |
### Instruction:
Draw a bar chart for what are the average prices of products, grouped by manufacturer name?, and I want to rank x-axis in ascending order.
### Response:
| SELECT T2.Name, AVG(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name |
### Instruction:
what's the party with opponent being marcy kaptur (d) 75.3% randy whitman (r) 24.7%
### Response:
| SELECT "Party" FROM table_690 WHERE "Opponent" = 'Marcy Kaptur (D) 75.3% Randy Whitman (R) 24.7%' |
### Instruction:
how many black/haitian patients had the drug route both eyes?
### Response:
| 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.route = "BOTH EYES" |
### Instruction:
For those records from the products and each product's manufacturer, give me the comparison about the sum of manufacturer over the headquarter , and group by attribute headquarter by a bar chart.
### Response:
| SELECT Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter |
### Instruction:
Find the number of courses that have more than one prerequisites for each department in a bar chart, and could you sort in ascending by the bars?
### Response:
| SELECT dept_name, COUNT(dept_name) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY dept_name ORDER BY dept_name |
### Instruction:
What is the 2006 value with a 2011 value greater than 4113 and a 2008 value less than 7181?
### Response:
| SELECT SUM("2006") FROM table_70546 WHERE "2011" > '4113' AND "2008" < '7181' |
### Instruction:
What were the w/l when the final score was 2 6, 5 7, 7 6 (11 9) , 1 6?
### Response:
| SELECT w_l FROM table_23563375_11 WHERE result = "2–6, 5–7, 7–6 (11–9) , 1–6" |
### Instruction:
what is the number of patients whose year of birth is less than 2121 and lab test fluid is blood?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2121" AND lab.fluid = "Blood" |
### Instruction:
What is the name of the primary with a DCSF number larger than 2337 and an Ofsted number smaller than 135339?
### Response:
| SELECT "Name" FROM table_33918 WHERE "Type" = 'primary' AND "DCSF number" > '2337' AND "Ofsted number" < '135339' |
### Instruction:
how many patients aged below 27 years had the diagnosis long title tietze's disease?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "27" AND diagnoses.long_title = "Tietze's disease" |
### Instruction:
List of posts with edits from same user rejected in a row.
### Response:
| SELECT PostId AS "post_link", OwnerUserId AS "user_link", COUNT(Id) AS SuggestionCount FROM SuggestedEdits WHERE NOT RejectionDate IS NULL AND NOT OwnerUserId IS NULL GROUP BY PostId, OwnerUserId ORDER BY SuggestionCount DESC LIMIT 100 |
### Instruction:
Find out the number of male patients who have an arip10 drug code.
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.formulary_drug_cd = "ARIP10" |
### Instruction:
give me the number of patients who were ordered d-dimer lab test and admitted before 2123.
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2123" AND lab.label = "D-Dimer" |
### Instruction:
Which region (year) has Abigail at number 7, Sophia at number 1 and Aaliyah at number 5?
### Response:
| SELECT "Region (year)" FROM table_48021 WHERE "No. 7" = 'abigail' AND "No. 1" = 'sophia' AND "No. 5" = 'aaliyah' |
### Instruction:
What is the 1USD= that has the Uruguayan Peso (uyu) and 1 Euro is greater than 25.3797?
### Response:
| SELECT SUM("1 USD =") FROM table_71333 WHERE "Currency" = 'uruguayan peso (uyu)' AND "1 Euro =" > '25.3797' |
### Instruction:
Find the dates on which more than one revisions were made, and the bin the date of latest revision into weekday interval and count them as a bar chart, and I want to list in desc by the Y-axis.
### Response:
| SELECT date_of_latest_revision, COUNT(date_of_latest_revision) FROM Catalogs ORDER BY COUNT(date_of_latest_revision) DESC |
### Instruction:
Show the id and details for the investors who have the top 3 number of transactions.
### Response:
| SELECT T2.investor_id, T1.investor_details FROM investors AS T1 JOIN transactions AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY COUNT(*) DESC LIMIT 3 |
### Instruction:
When seats for 2001 is greater than 15 and % 2001 is greater than 100, what is the % 2006?
### Response:
| SELECT AVG(_percentage_2006) FROM table_name_70 WHERE seats_2001 > 15 AND _percentage_2001 > 100 |
### Instruction:
Give the number of patients admitted in urgent care and have their drug type as base.
### 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_type = "BASE" |
### Instruction:
Before the year 2010, and when Kalamazoo had a passenger fare of $517.32, what was the passenger fare for Detroit?
### Response:
| SELECT "Detroit (DTW)" FROM table_9693 WHERE "Year" < '2010' AND "Kalamazoo (AZO)" = '$517.32' |
### Instruction:
Which Oberliga Baden-W rttemberg has an Oberliga Hessen of fsv frankfurt in 1993-94?
### Response:
| SELECT "Oberliga Baden-W\u00fcrttemberg" FROM table_75234 WHERE "Oberliga Hessen" = 'fsv frankfurt' AND "Season" = '1993-94' |
### Instruction:
Is there any upper-level classes without exams that have projects ?
### Response:
| SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND course.has_projects = 'Y' AND program_course.category LIKE 'ULCS' |
### Instruction:
What is the average salary for each job title Show bar chart, display by the names from low to high.
### 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 JOB_TITLE |
### Instruction:
provide the number of patients whose days of hospital stay is greater than 23 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.days_stay > "23" AND prescriptions.route = "SC" |
### Instruction:
Name the mixed doubles with martine ludwig angele da cruz, and men's doubles of christian wagener christian esch
### Response:
| SELECT "Mixed doubles" FROM table_6544 WHERE "Women's doubles" = 'martine ludwig angele da cruz' AND "Men's doubles" = 'christian wagener christian esch' |
### Instruction:
how many emergency hospital admission patients have lab test item id 51259?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.itemid = "51259" |
### Instruction:
how many patients posses private insurance and were procedured with contrast arteriogram-leg?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Contrast arteriogram-leg" |
### Instruction:
For those employees who was hired before 2002-06-21, show me about the distribution of hire_date and the sum of salary bin hire_date by weekday in a bar chart.
### Response:
| SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' |
### Instruction:
Which Age (as of 1 February 2014) has a Rank smaller than 9, and a Death date of 24 january 2007?
### Response:
| SELECT age__as_of_1_february_2014_ FROM table_name_3 WHERE rank < 9 AND death_date = "24 january 2007" |
### Instruction:
On which date was the game where the home teams score was 22.15 (147), and the away teams score was 9.8 (62)
### Response:
| SELECT "Date" FROM table_53520 WHERE "Home team score" = '22.15 (147)' AND "Away team score" = '9.8 (62)' |
### Instruction:
how many female patients are primarily diagnosed for left internal jugular vein thrombosis left arm edema?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" |
### Instruction:
Highest upvote with out any downvote.
### Response:
| SELECT MAX(PO.Score), PT.Name, PO.Id FROM Posts AS PO INNER JOIN PostTypes AS PT ON PT.Id = PO.PostTypeId WHERE PO.DeletionDate IS NULL AND PT.Id IN (1, 2) GROUP BY PT.Name, PO.Id LIMIT 10 |
### Instruction:
Find the id and local authority of the station whose maximum precipitation is higher than 50.
### Response:
| SELECT t2.id, t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id GROUP BY t1.station_id HAVING MAX(t1.precipitation) > 50 |
### Instruction:
how many patients whose death status is 0 and procedure icd9 code is 5012?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "5012" |
### Instruction:
Can you tell me the Player that has the Round smaller than 6, and the College/Junior/Club Team of hull olympiques (qmjhl)?
### Response:
| SELECT "Player" FROM table_34309 WHERE "Round" < '6' AND "College/Junior/Club Team" = 'hull olympiques (qmjhl)' |
Subsets and Splits