instruction
stringlengths 57
490
| output
stringlengths 69
1.29k
|
---|---|
### Instruction:
What was the average year that the Nashville Metros did not qualify for the Playoffs, did not qualify for the Open Cup, and had the Regular Season 7th, Southeast?
### Response:
| SELECT AVG(year) FROM table_name_78 WHERE playoffs = "did not qualify" AND open_cup = "did not qualify" AND regular_season = "7th, southeast" |
### Instruction:
since 1 year ago patient 013-33898 had been in an er?
### Response:
| SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '013-33898' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-1 year') |
### Instruction:
How many years did barclay nordica arrows bmw enter with a bmw str-4 t/c engine with less than 1 point?
### Response:
| SELECT SUM("Year") FROM table_70405 WHERE "Engine" = 'bmw str-4 t/c' AND "Entrant" = 'barclay nordica arrows bmw' AND "Points" < '1' |
### Instruction:
how many party with candidates being john m. vorys (r) 61.5% jacob f. myers (d) 38.5%
### Response:
| SELECT COUNT("Party") FROM table_18486 WHERE "Candidates" = 'John M. Vorys (R) 61.5% Jacob F. Myers (D) 38.5%' |
### Instruction:
count the number of patients whose age is less than 64 and drug code is warf1?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "64" AND prescriptions.formulary_drug_cd = "WARF1" |
### Instruction:
What position does the Wales player who made more than 167 appearances, had more than 0 goals, and had a Leeds career from 1977 1982 play?
### Response:
| SELECT position FROM table_name_56 WHERE appearances > 167 AND nationality = "wales" AND goals > 0 AND leeds_career = "1977–1982" |
### Instruction:
For those employees who was hired before 2002-06-21, draw a line chart about the change of salary over hire_date , and show from high to low by the HIRE_DATE.
### Response:
| SELECT HIRE_DATE, SALARY FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC |
### Instruction:
give me the number of medicaid patients who have diagnoses icd9 code 99659.
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicaid" AND diagnoses.icd9_code = "99659" |
### Instruction:
who is the NBA team for the draft year after 2003 with a height of 6'10' and home town of st. charles, mo?
### Response:
| SELECT "NBA Team" FROM table_70626 WHERE "Draft Year" > '2003' AND "Height" = '6''10' AND "Hometown" = 'st. charles, mo' |
### Instruction:
WHAT IS THE ORICON PEAK NUMBER WITH AN ATLANTIC LABEL, SUBHUMAN RACE, LATER THAN 1995?
### Response:
| SELECT COUNT("Oricon peak") FROM table_48368 WHERE "Label" = 'atlantic' AND "Title" = 'subhuman race' AND "Date of release" > '1995' |
### Instruction:
Which school district receive the most of federal revenue through state in Wisconsin?
### Response:
| SELECT T1.school_district FROM finrev_fed_17 AS T1 JOIN finrev_fed_key_17 AS T2 ON T1.state_code = T2.state_code WHERE T2.state = "Wisconsin" ORDER BY T1.t_fed_rev DESC LIMIT 1 |
### Instruction:
What is 2006/07, when 2011/12 is LQ, and when 2010/11 is LQ?
### Response:
| SELECT "2006/ 07" FROM table_76588 WHERE "2011/ 12" = 'lq' AND "2010/ 11" = 'lq' |
### Instruction:
In the year 1992 for the Seibu Lions, the BB + HBP which is larger than 49 was this as a BA (Place)?
### Response:
| SELECT "BA (Place)" FROM table_69873 WHERE "BB +HBP" > '49' AND "Team" = 'seibu lions' AND "Year" = '1992' |
### Instruction:
Popular MongoDB Queries by ViewCount.
### Response:
| SELECT Score, ViewCount, CreationDate, DATEDIFF(DAY, CreationDate, GETDATE()) AS "DaysOpen", (ViewCount / DATEDIFF(DAY, CreationDate, GETDATE())) AS "NewScore", LastActivityDate, Title, Id, Tags FROM Posts WHERE Title LIKE '%mongodb%' OR Tags LIKE '%mongodb%' ORDER BY NewScore DESC |
### Instruction:
provide the number of patients whose drug name is maalox/diphenhydramine/lidocaine?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Maalox/Diphenhydramine/Lidocaine" |
### Instruction:
What Scores by each individual judge has a Status of current, and a Co-contestant (Yaar vs. Pyaar) of krushna abhishek?
### Response:
| SELECT scores_by_each_individual_judge FROM table_name_67 WHERE status = "current" AND co_contestant__yaar_vs_pyaar_ = "krushna abhishek" |
### Instruction:
patients with uncontrolled diabetes will be excluded because high glucose will alter the fdg _ pet studies. the clinic that does pet ( columbia university medical center ) excludes patients if glucose values exceed 200 mg / ml.
### Response:
| SELECT * FROM table_train_81 WHERE uncontrolled_diabetes = 0 OR high_glucose = 0 |
### Instruction:
Find the names of scientists who are not working on the project with the highest hours.
### Response:
| SELECT name FROM scientists EXCEPT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.ssn WHERE T2.hours = (SELECT MAX(hours) FROM projects) |
### Instruction:
what is the average total when bronze is more than 0, gold is 0, the nation is united states (usa) and silver is 0?
### Response:
| SELECT AVG("Total") FROM table_50718 WHERE "Bronze" > '0' AND "Gold" = '0' AND "Nation" = 'united states (usa)' AND "Silver" < '0' |
### Instruction:
give the number of patients whose insurance is medicaid and diagnosis short title is drug induced neutropenia.
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicaid" AND diagnoses.short_title = "Drug induced neutropenia" |
### Instruction:
What are the last names and ages of the students who are allergic to milk and cat? Plot them as bar chart, and order in asc by the Y.
### Response:
| SELECT LName, Age FROM Student WHERE StuID IN (SELECT StuID FROM Has_Allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_Allergy WHERE Allergy = "Cat") ORDER BY Age |
### Instruction:
provide the number of patients whose admission type is elective and procedure icd9 code is 4611?
### Response:
| 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 = "4611" |
### Instruction:
What's China's highest 1985-1990 assuming a 2000-2005 larger than 3.08?
### Response:
| SELECT MAX("1985-1990") FROM table_34953 WHERE "Region/country" = 'china' AND "2000-2005" > '3.08' |
### Instruction:
provide the number of patients whose ethnicity is black/haitian and lab test name is id, body fluid.
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND lab.label = "LD, Body Fluid" |
### Instruction:
what is the points when the entrant is brabham racing organisation, the year is 1964 and the chassis is brabham bt7?
### Response:
| SELECT "Points" FROM table_49672 WHERE "Entrant" = 'brabham racing organisation' AND "Year" = '1964' AND "Chassis" = 'brabham bt7' |
### Instruction:
How many services has each resident requested? List the resident id, details, and the count in descending order of the count.
### Response:
| SELECT T1.resident_id, T1.other_details, COUNT(*) FROM Residents AS T1 JOIN Residents_Services AS T2 ON T1.resident_id = T2.resident_id GROUP BY T1.resident_id ORDER BY COUNT(*) DESC |
### Instruction:
waist to hip ratio greater than or equal to 0.8 ( female ) and greater than or equal to 0.95 ( male )
### Response:
| SELECT * FROM table_train_250 WHERE (waist_to_hip_ratio >= 0.8 AND gender = 'female') OR (waist_to_hip_ratio >= 0.95 AND gender = 'male') |
### Instruction:
how many patients are admitted before 2156 and diagnosed with end stage renal disease?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2156" AND diagnoses.short_title = "End stage renal disease" |
### Instruction:
did patient 015-100195 come into an er in 2105?
### Response:
| SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '015-100195' AND patient.hospitaladmitsource = 'emergency department' AND STRFTIME('%y', patient.unitadmittime) = '2105' |
### Instruction:
what is the number of patients whose admission type is emergency and item id is 51300?
### 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 = "51300" |
### Instruction:
What is the release date of the episode named Mouse-Placed Kitten with an episode number less than 1495 directed by Robert McKimson?
### Response:
| SELECT "Release date" FROM table_65141 WHERE "Production Number" < '1495' AND "Director" = 'robert mckimson' AND "Title" = 'mouse-placed kitten' |
### Instruction:
provide the number of patients whose marital status is married and procedure long title is other transplant of liver?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.long_title = "Other transplant of liver" |
### Instruction:
What is the Catalog when the format is ed remaster cd, and a Label of village records, and a Date of march 13, 2002?
### Response:
| SELECT "Catalog" FROM table_7666 WHERE "Format" = 'ed remaster cd' AND "Label" = 'village records' AND "Date" = 'march 13, 2002' |
### Instruction:
What is the total number of First Elected that has counties represented of Anne Arundel, District of 30, and a Ways and Means Committee?
### Response:
| SELECT COUNT("First Elected") FROM table_71330 WHERE "Counties Represented" = 'anne arundel' AND "District" = '30' AND "Committee" = 'ways and means' |
### Instruction:
Show the pair of male and female names in all weddings after year 2014
### Response:
| SELECT T2.name, T3.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id JOIN people AS T3 ON T1.female_id = T3.people_id WHERE T1.year > 2014 |
### Instruction:
what paper has Clifford Grobstein published in Science ?
### Response:
| SELECT DISTINCT paper.paperid FROM author, paper, venue, writes WHERE author.authorname = 'Clifford Grobstein' AND venue.venueid = paper.venueid AND venue.venuename = 'Science' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid |
### Instruction:
what is the number of patients admitted in hospital before 2180 who had albumin, pleural lab test?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2180" AND lab.label = "Albumin, Pleural" |
### Instruction:
For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by weekday.
### Response:
| SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' |
### Instruction:
What was the team from Austria when the Netherlands sent Brunssum/Schinnen LL Brunssum and Belgium sent Shape and Waterloo LL Brussels?
### Response:
| SELECT austria FROM table_28562675_3 WHERE netherlands = "Brunssum/Schinnen LL Brunssum" AND belgium = "SHAPE and Waterloo LL Brussels" |
### Instruction:
what is the number of patients whose drug route is tp and admission year is before 2167?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2167" AND prescriptions.route = "TP" |
### Instruction:
What is the percent change (1990 2000) when the 2007 estimate is 0 1,598,161?
### Response:
| SELECT "Percent Change (1990\u20132000)" FROM table_543 WHERE "2007 Estimate" = '0 1,598,161' |
### Instruction:
What is the to par of the player from the United States with a t6 place and a score of 70-73-68-73=284?
### Response:
| SELECT to_par FROM table_name_22 WHERE country = "united states" AND place = "t6" AND score = 70 - 73 - 68 - 73 = 284 |
### Instruction:
what's the thursday time with sunday being 1:00-5:00 and tuesday being 1:00-7:00
### Response:
| SELECT thursday FROM table_11019212_1 WHERE sunday = "1:00-5:00" AND tuesday = "1:00-7:00" |
### Instruction:
among patients aged below 86, how many of them had rt & lt heart angiocard?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "86" AND procedures.short_title = "Rt & lt heart angiocard" |
### Instruction:
For each room, find its name and the number of times reservations were made for it, you can use the data to draw a bar chart, could you display by the the total number in desc please?
### Response:
| SELECT roomName, COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY COUNT(*) DESC |
### Instruction:
What are recent papers on Visual Detection ?
### Response:
| SELECT DISTINCT paper.paperid, paper.year FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Visual Detection' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid ORDER BY paper.year DESC |
### Instruction:
When 380 g/mi (236 g/km) is the dirty electric grid rocky mountains (denver) what is the u.s national average electric mix?
### Response:
| SELECT "U.S. national average electric mix" FROM table_27012 WHERE "Dirty electric grid Rocky Mountains (Denver)" = '380 g/mi (236 g/km)' |
### Instruction:
Most popular tags in last year.
### Response:
| SELECT TagName, COUNT(PostId) AS Rate FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND YEAR(Posts.CreationDate) >= 2019 GROUP BY TagName HAVING COUNT(PostId) > 10000 ORDER BY Rate DESC |
### Instruction:
how many patients are born before 2182 and suggested with drug route via iv bolus?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2182" AND prescriptions.route = "IV BOLUS" |
### Instruction:
Rate of accepted answers for the site.
### Response:
| SELECT COUNT(q.Id), COUNT(q2.Id), ROUND(COUNT(q2.Id) * 100 / COUNT(q.Id), 2) FROM Posts AS q LEFT JOIN Posts AS q2 ON q.Id = q2.Id AND q.AnswerCount > 0 WHERE q.PostTypeId = 1 |
### Instruction:
count the number of patients whose admission type is emergency and drug route is buccal?
### Response:
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.route = "BUCCAL" |
### Instruction:
Who was the race winner with a pole position james hunt, and a Fastest Lap of james hunt, and a Date of 15 august?
### Response:
| SELECT "Race Winner" FROM table_56239 WHERE "Pole Position" = 'james hunt' AND "Fastest Lap" = 'james hunt' AND "Date" = '15 august' |
### Instruction:
What are the first names of the different drivers who won in position 1 as driver standing and had more than 20 points?
### Response:
| SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20 |
### Instruction:
Find the distinct student first names of all students that have grade point at least 3.8 in one course.
### Response:
| SELECT DISTINCT T3.fname FROM enrolled_in AS T1 JOIN gradeconversion AS T2 JOIN student AS T3 ON T1.grade = T2.lettergrade AND T1.stuid = T3.stuid WHERE T2.gradepoint >= 3.8 |
### Instruction:
the london emirates air line pylon has the same height as which pylon ?
### Response:
| SELECT "name" FROM table_203_375 WHERE "name" <> 'london emirates air line' AND "height" = (SELECT "height" FROM table_203_375 WHERE "name" = 'london emirates air line') |
### Instruction:
What is the 1985 value for the year when GDP as of 2012 after PPP was 369.38?
### Response:
| SELECT "1985" FROM table_31522 WHERE "GDP as of 2012 after purchasing power parity (PPP) calculations (USD billions)" = '369.38' |
### 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:
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:
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 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:
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:
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 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:
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:
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:
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 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:
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)' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.