instruction
stringlengths
53
549
output
stringlengths
30
2.33k
### Instruction: What date has Vancouver Canucks as the original team, Ryan Kesler as the player, and matched as the Result? ### Response:
SELECT "Date" FROM table_70646 WHERE "Original Team" = 'vancouver canucks' AND "Result" = 'matched' AND "Player" = 'ryan kesler'
### Instruction: find long waiting suggested edits. ### Response:
SELECT CAST((JULIANDAY(COALESCE(ApprovalDate, RejectionDate, CreationDate)) - JULIANDAY(CreationDate)) AS INT) FROM SuggestedEdits WHERE NOT ApprovalDate IS NULL OR NOT RejectionDate IS NULL ORDER BY 1 DESC
### Instruction: Which Round was Player Adam Cracknell Picked after 231 in a Draft year after 1988? ### Response:
SELECT "Round" FROM table_55237 WHERE "Pick" > '231' AND "Draft" > '1988' AND "Player" = 'adam cracknell'
### Instruction: What is the title of the prerequisite class of International Finance course? ### Response:
SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'International Finance')
### Instruction: Name the President who has a Treasurer of james davidson, and a Season of 2006 2007? ### Response:
SELECT "President" FROM table_8089 WHERE "Treasurer" = 'james davidson' AND "Season" = '2006–2007'
### Instruction: In what Weeks is the game against the Tampa Bay Buccaneers with less than 44,506 in Attendance? ### Response:
SELECT SUM("Week") FROM table_47699 WHERE "Opponent" = 'tampa bay buccaneers' AND "Attendance" < '44,506'
### Instruction: how many male patients had the lab test name potassium, whole blood? ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.label = "Potassium, Whole Blood"
### Instruction: In the tkkm o manawatu coed school in kelvin grove, what is the Authority listed/ ### Response:
SELECT "Authority" FROM table_71426 WHERE "Gender" = 'coed' AND "Area" = 'kelvin grove' AND "Name" = 'tkkm o manawatu'
### Instruction: Which LEMA/SUBLEMA that has Votes smaller than 218656, and a Ch of Deputies of 0? ### Response:
SELECT "LEMA/SUBLEMA" FROM table_36816 WHERE "Votes" < '218656' AND "Ch. of Deputies" = '0'
### Instruction: What is the number in the season that Marlene Meyer wrote and 20.49 million people watched? ### Response:
SELECT MAX(no_in_season) FROM table_10718984_2 WHERE written_by = "Marlene Meyer" AND us_viewers__millions_ = "20.49"
### Instruction: In what Year is the Isis Population 4,082 and the Regional Population less than 55,990? ### Response:
SELECT COUNT("Year") FROM table_15266 WHERE "Population (Isis)" = '4,082' AND "Population (Region total)" < '55,990'
### Instruction: how much does it cost for nacl 0.9% bolus? ### Response:
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'nacl 0.9% bolus')
### Instruction: give me the number of patients whose primary disease is st elevated myocardial infarction\cardiac cath? ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH"
### Instruction: Show me about the distribution of ACC_Road and the sum of Team_ID , and group by attribute ACC_Road in a bar chart, show from low to high by the Y. ### Response:
SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY SUM(Team_ID)
### Instruction: who was an opponent in 1996 and 1997 ? ### Response:
SELECT "opponent" FROM table_204_790 WHERE "year" = 1996 INTERSECT SELECT "opponent" FROM table_204_790 WHERE "year" = 1997
### Instruction: give me the number of patients whose days of hospital stay is greater than 15 and admission year is less than 2162? ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.days_stay > "15" AND demographic.admityear < "2162"
### Instruction: What is Mass, when Launch Date/Time ( GMT ) is 25 November 1976, 03:59? ### Response:
SELECT "Mass" FROM table_12857 WHERE "Launch date/time ( GMT )" = '25 november 1976, 03:59'
### Instruction: Show all director names who have a movie in the year 1999 or 2000, and count them by a bar chart, and could you display by the Director in ascending? ### Response:
SELECT Director, COUNT(Director) FROM movie WHERE Year = 1999 OR Year = 2000 GROUP BY Director ORDER BY Director
### Instruction: A bar chart for returning the number of the date of birth for all the guests with gender code 'Male', and rank from low to high by the y axis. ### Response:
SELECT date_of_birth, COUNT(date_of_birth) FROM Guests WHERE gender_code = "Male" ORDER BY COUNT(date_of_birth)
### Instruction: When declaring BCS as a major what classes do I need to take ? ### Response:
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%BCS%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id
### Instruction: What's the average number of floors that were built in 2004, and have a roof (m) of 106? ### Response:
SELECT AVG("Floors") FROM table_71603 WHERE "Built" = '2004' AND "Roof ( m )" = '106'
### Instruction: What is the Partner with Opponents in the final with roy emerson rod laver, with Date smaller than 1975? ### Response:
SELECT "Partner" FROM table_53734 WHERE "Opponents in the final" = 'roy emerson rod laver' AND "Date" < '1975'
### Instruction: Get Posts and Upvotes for Last X days. This query takes in a given integer X and returns all posts from the last X days as well as the votes on each of those posts. ### Response:
SELECT COUNT(DISTINCT Posts.Id) FROM Posts WHERE Posts.CreationDate >= CURRENT_TIMESTAMP() - @numDays
### Instruction: is the south open purse the same as the center open purse ? ### Response:
SELECT (SELECT "purse ($)" FROM table_204_865 WHERE "tournament" = 'south open') = (SELECT "purse ($)" FROM table_204_865 WHERE "tournament" = 'center open')
### Instruction: How many weeks had a game on November 26, 1978, and an attendance higher than 26,248? ### Response:
SELECT COUNT(week) FROM table_name_88 WHERE date = "november 26, 1978" AND attendance > 26 OFFSET 248
### Instruction: What is the outcome of the 4 6, 6 4, 6 3, 7 6 (7 2) score? ### Response:
SELECT "Outcome" FROM table_75927 WHERE "Score" = '4–6, 6–4, 6–3, 7–6 (7–2)'
### Instruction: What Category has a Year that's smaller than 2006, has Result of Nominated, and a Title of Cold Feet? ### Response:
SELECT "Category" FROM table_67214 WHERE "Year" < '2006' AND "Result" = 'nominated' AND "Title" = 'cold feet'
### Instruction: Which paper should I read about dependent types ? ### Response:
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'dependent types' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
### Instruction: what is insurance and diagnoses icd9 code of subject id 21796? ### Response:
SELECT demographic.insurance, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "21796"
### Instruction: What is the Place of the Player with a To par of +2 and a Score of 70-72-73=215? ### Response:
SELECT "Place" FROM table_46746 WHERE "To par" = '+2' AND "Score" = '70-72-73=215'
### Instruction: how many patients primarily suffering from sdh had their lab test fluid as urine? ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "SDH" AND lab.fluid = "Urine"
### Instruction: Which students are advised by Michael Goodrich? Give me their first and last names. ### Response:
SELECT T2.fname, T2.lname FROM faculty AS T1 JOIN student AS T2 ON T1.facid = T2.advisor WHERE T1.fname = "Michael" AND T1.lname = "Goodrich"
### Instruction: A bar chart shows the distribution of ACC_Road and the average of School_ID , and group by attribute ACC_Road, list Y-axis in asc order. ### Response:
SELECT ACC_Road, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(School_ID)
### Instruction: Which Effic is the highest one that has an Avg/G smaller than 305.6, and a GP-GS of 13-13? ### Response:
SELECT MAX(effic) FROM table_name_56 WHERE avg_g < 305.6 AND gp_gs = "13-13"
### Instruction: how many patients aged below 31 years had sc as the drug route? ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "31" AND prescriptions.route = "SC"
### Instruction: how many male patients are tested with lab test item id 51180? ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.itemid = "51180"
### Instruction: When tommy smith category:articles with hcards is the player and 1 is the goal how many cap(s) are there? ### Response:
SELECT COUNT(cap_s_) FROM table_28286776_50 WHERE goal_s_ = 1 AND player = "Tommy Smith Category:Articles with hCards"
### Instruction: What are the official languages of the countries of players from Maryland or Duke college? ### Response:
SELECT T1.Official_native_language FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.College = "Maryland" OR T2.College = "Duke"
### Instruction: What is the total number of points for the conference division, a league position of 9th, and a lost result less than 13? ### Response:
SELECT COUNT("Points") FROM table_67072 WHERE "Division" = 'conference' AND "League Pos" = '9th' AND "Lost" < '13'
### Instruction: Show all party names and the number of members in each party Show bar chart, and rank by the names from low to high please. ### Response:
SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY Party_name
### Instruction: Which 250cc winner has a 125cc winner of bradley smith, and a Circuit of mugello? ### Response:
SELECT "250cc winner" FROM table_37239 WHERE "125cc winner" = 'bradley smith' AND "Circuit" = 'mugello'
### Instruction: What is the time or retired time for timo glock with under 70 laps and a grid number greater than 15? ### Response:
SELECT "Time/Retired" FROM table_55395 WHERE "Laps" < '70' AND "Grid" > '15' AND "Driver" = 'timo glock'
### Instruction: Draw a bar chart about the distribution of date_address_to and the average of monthly_rental , and group by attribute other_details and bin date_address_to by time. ### Response:
SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
### Instruction: For those employees who was hired before 2002-06-21, show me about the correlation between employee_id and manager_id in a scatter chart. ### Response:
SELECT EMPLOYEE_ID, MANAGER_ID FROM employees WHERE HIRE_DATE < '2002-06-21'
### Instruction: What is the To par of the United States, when the Total was 145, in 2004? ### Response:
SELECT "To par" FROM table_13578 WHERE "Country" = 'united states' AND "Total" = '145' AND "Year(s) won" = '2004'
### Instruction: What is the Opposition in the First Round of the UEFA Cup with a Score of 3 1 (h), 2 0 (a)? ### Response:
SELECT opposition FROM table_name_66 WHERE round = "first round" AND competition = "uefa cup" AND score = "3–1 (h), 2–0 (a)"
### Instruction: Which papers cite Daniel A Reed ? ### Response:
SELECT DISTINCT paper.paperid FROM author, cite, paper, writes WHERE author.authorname = 'Daniel A Reed' AND paper.paperid = cite.citingpaperid AND writes.authorid = author.authorid AND writes.paperid = cite.citedpaperid
### Instruction: Who was the EP winning team when the CP winning team was Dave Clark and the GM winning team was Stuart Northrup? ### Response:
SELECT ep_winning_team FROM table_29225103_2 WHERE cp_winning_team = "Dave Clark" AND gm_winning_team = "Stuart Northrup"
### Instruction: What is the Rank (Pakistan) of the mountain that has a World Rank smaller than 11 and a Height smaller than 8126? ### Response:
SELECT COUNT("Rank (Pakistan)") FROM table_54098 WHERE "World Rank" < '11' AND "Height (m)" < '8126'
### Instruction: What is the average number of gold medals Switzerland received when they ranked larger than 1st and received fewer than 10 bronze medals and more than 1 silver medal? ### Response:
SELECT AVG(gold) FROM table_name_90 WHERE total > 1 AND bronze < 10 AND nation = "switzerland" AND silver > 1
### Instruction: what group has the same number of caucusing members as rpr group ? ### Response:
SELECT "group" FROM table_203_266 WHERE "group" <> 'rpr group' AND "caucusing" = (SELECT "caucusing" FROM table_203_266 WHERE "group" = 'rpr group')
### Instruction: What are the names of races held between 2009 and 2011, and count them by a bar chart, I want to order from high to low by the x axis. ### Response:
SELECT name, COUNT(name) FROM races WHERE year BETWEEN 2009 AND 2011 GROUP BY name ORDER BY name DESC
### Instruction: What is the sum of the total apps of player benayoun, who has a PL G greater than 0 and more than 9 CL apps? ### Response:
SELECT SUM("Total Apps") FROM table_8287 WHERE "PL G" > '0' AND "Player" = 'benayoun' AND "CL Apps" > '9'
### Instruction: What is the nationality associated with 0 minutes, position of MF, and an Athletica career of 2009? ### Response:
SELECT "Nationality" FROM table_26450 WHERE "Minutes" = '0' AND "Position" = 'MF' AND "Athletica career" = '2009'
### Instruction: What is the lambda function without a pseudorandom number generation, no s default argument, no functions, and no eval function? ### Response:
SELECT lambda_functions FROM table_name_10 WHERE pseudorandom_number_generation = "no" AND s_default_argument = "no" AND functions = "no" AND eval_function = "no"
### Instruction: Of the upper level classes , do any of them give 14 credits ? ### 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.credits = 14 AND program_course.category LIKE 'ULCS'
### Instruction: When 1985-2007 yamaha v-max honda vfr800 is the example what is the engine is it? ### Response:
SELECT "Engine" FROM table_25558 WHERE "Example" = '1985-2007 Yamaha V-Max Honda VFR800'
### Instruction: ad subject has a screen mmse raw score > 16 or hc subject has a screen mmse raw score > 26 . ### Response:
SELECT * FROM table_train_94 WHERE mini_mental_state_examination_mmse > 16 OR mini_mental_state_examination_mmse > 26
### Instruction: Please give me a bar chart to show the market share of different furniture name, which no any company is producing in our records by a pie chart, list in ascending by the bar. ### Response:
SELECT Name, Market_Rate FROM furniture WHERE NOT Furniture_ID IN (SELECT Furniture_ID FROM furniture_manufacte) ORDER BY Name
### Instruction: give me the number of patients whose primary disease is acute subdural hematoma and age is less than 83? ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ACUTE SUBDURAL HEMATOMA" AND demographic.age < "83"
### Instruction: Vancouver SO Users By Rep. ### Response:
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", u.Id AS "user_link", u.Reputation FROM Users AS u WHERE LOWER(Location) LIKE LOWER('%manchester%') GROUP BY u.Id, u.Reputation ORDER BY Reputation DESC
### Instruction: Find the id and last name of the student that has the most behavior incidents? ### Response:
SELECT T1.student_id, T2.last_name FROM behavior_incident AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: What is Name, when Status is Valid, when Authors is Maisch, when Location is Tanzania, and when Novelty is Gen Et Sp Nov? ### Response:
SELECT name FROM table_name_24 WHERE status = "valid" AND authors = "maisch" AND location = "tanzania" AND novelty = "gen et sp nov"
### Instruction: count the total number of hospital visits of patient 3535 until 2104. ### Response:
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 3535 AND STRFTIME('%y', admissions.admittime) <= '2104'
### Instruction: Which Total has a Club of darlington, and a League goals of 13, and a League Cup goals of 1? ### Response:
SELECT SUM("Total") FROM table_43812 WHERE "Club" = 'darlington' AND "League goals" = '13' AND "League Cup goals" = '1'
### Instruction: What is the original air date of the episode titled 'Mom at the Bar/Train Buddy' that was written b Adrienne Carter? ### Response:
SELECT "Original air date" FROM table_25346 WHERE "Written by" = 'Adrienne Carter' AND "Title" = 'Mom at the Bar/Train Buddy'
### Instruction: What is Score, when Location Attendance is 'US Airways Center 18,422', and when Game is less than 22? ### Response:
SELECT "Score" FROM table_44934 WHERE "Location Attendance" = 'us airways center 18,422' AND "Game" < '22'
### Instruction: For those employees whose first name is ending with the letter m, sum their salary for visualizing a bar chart, and order by the names from low to high please. ### Response:
SELECT FIRST_NAME, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME ORDER BY FIRST_NAME
### Instruction: What are the ids of instructors who taught in the Fall of 2009 but not in the Spring of 2010? ### Response:
SELECT id FROM teaches WHERE semester = 'Fall' AND year = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND year = 2010
### Instruction: What date did the T328 that entered service on 18 June 1956 re-enter service? ### Response:
SELECT re_entered_service__p_ FROM table_name_22 WHERE entered_service__t_ = "18 june 1956" AND pre_conversion = "t328"
### Instruction: What are the downloaded numbers of 2000s and before 2000? ### Response:
SELECT SUM(totalsnatched) FROM torrents WHERE groupyear BETWEEN 2000 AND 2010 UNION SELECT SUM(totalsnatched) FROM torrents WHERE groupyear < 2000
### Instruction: What was the airdate of the episode that was directed by giancarlo volpe and written by is john o'bryan? ### Response:
SELECT "Original air date" FROM table_19394 WHERE "Directed by" = 'Giancarlo Volpe' AND "Written by" = 'John O''Bryan'
### Instruction: Who has a term that expires on December 31, 2020 and Terry Branstad for an appointing governor? ### Response:
SELECT "Name" FROM table_11792 WHERE "Term expires" = 'december 31, 2020' AND "Appointing Governor" = 'terry branstad'
### Instruction: is the total score for december 26 the same score as january 2 ? ### Response:
SELECT (SELECT "score" FROM table_203_517 WHERE "date" = 'december 26') = (SELECT "score" FROM table_203_517 WHERE "date" = 'january 2')
### Instruction: Show the average room count of the apartments that have booking status code 'Provisional'. ### Response:
SELECT AVG(room_count) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Provisional"
### Instruction: What is the highest poll of the advocate Andy Kindler with poll losses greater than 2 and ties less than 0? ### Response:
SELECT MAX("Poll wins") FROM table_40419 WHERE "Poll losses" > '2' AND "Advocate" = 'andy kindler' AND "Ties" < '0'
### Instruction: What is the total number of ratings among the 18 to 49 group that was aired on January 7, 2009? ### Response:
SELECT COUNT("18\u201349") FROM table_51323 WHERE "Air Date" = 'january 7, 2009'
### Instruction: What are the fewest wickets when player's career spanned 1946-1960 and maidens were more than 419? ### Response:
SELECT MIN(wickets) FROM table_name_84 WHERE career = "1946-1960" AND maidens > 419
### Instruction: Name the lfop 4/24/09 for opinionway of 4/17/09 of 5% for party of left front ### Response:
SELECT ifop_4_24_09 FROM table_name_43 WHERE opinionway_4_17_09 = "5%" AND party = "left front"
### Instruction: how many different men held the wsl title before horshu won his first wsl title ? ### Response:
SELECT COUNT(DISTINCT "wrestler:") FROM table_204_684 WHERE "date:" < (SELECT "date:" FROM table_204_684 WHERE "wrestler:" = 'horshu')
### Instruction: How many Winners have Wins of 1 and a Country of fiji and a First title smaller than 2004? ### Response:
SELECT AVG("Winners") FROM table_42706 WHERE "Wins" = '1' AND "Country" = 'fiji' AND "First title" < '2004'
### Instruction: Which 1st Party has a 2nd Member of sir charles wood, and a 1st Member of sir francis crossley? ### Response:
SELECT "1st Party" FROM table_12844 WHERE "2nd Member" = 'sir charles wood' AND "1st Member" = 'sir francis crossley'
### Instruction: find out the short title of diagnoses and diagnoses icd9 code for patient michelle medina. ### Response:
SELECT diagnoses.icd9_code, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Michelle Medina"
### Instruction: What league has a D position, a round smaller than 11 and is with Dennis Vial? ### Response:
SELECT "College/Junior/Club Team (League)" FROM table_5640 WHERE "Position" = 'd' AND "Round" < '11' AND "Player" = 'dennis vial'
### Instruction: display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara excluding Clara. ### Response:
SELECT first_name, last_name, hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = "Clara") AND first_name <> "Clara"
### Instruction: how many more more bronze medals did russia earn than china ? ### Response:
SELECT (SELECT "bronze" FROM table_203_739 WHERE "nation" = 'russia') - (SELECT "bronze" FROM table_203_739 WHERE "nation" = 'china')
### Instruction: select by tag protected sorted. ### Response:
SELECT COUNT(Posts.Id) FROM Tags JOIN PostTags ON Tags.Id = PostTags.TagId JOIN Posts ON PostTags.PostId = Posts.Id JOIN PostHistory ON PostHistory.PostId = Posts.Id WHERE TagName = 'java' AND PostHistoryTypeId = 19
### Instruction: Top 200 users from Uganda. ### Response:
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%uganda%' OR UPPER(Location) LIKE '%UGA' ORDER BY Reputation DESC LIMIT 200
### Instruction: What are the id and details of the customers who have at least 3 events? ### Response:
SELECT T1.customer_id, T1.customer_details FROM customers AS T1 JOIN customer_events AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 3
### Instruction: Papers authored by Daniel S. Weld in 2011 ### Response:
SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'Daniel S. Weld' AND paper.year = 2011 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
### Instruction: For those employees who did not have any job in the past, show me the trend about commission_pct over hire_date with a line chart. ### Response:
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
### Instruction: Which tournament had a final score of 6 7, 2 6, and a Partner of wayne arthurs? ### Response:
SELECT "Tournament" FROM table_10809 WHERE "Score in the final" = '6–7, 2–6' AND "Partner" = 'wayne arthurs'
### Instruction: what is the number of patients whose diagnoses icd9 code is e8788? ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "E8788"
### Instruction: What is the chassis of Officine Alfieri Maserati with a Maserati Straight-6 engine and fewer than 6 points? ### Response:
SELECT chassis FROM table_name_55 WHERE engine = "maserati straight-6" AND entrant = "officine alfieri maserati" AND points < 6
### Instruction: What is Score, when Country is 'United States', when Place is 'T3', and when Player is 'Phil Blackmar'? ### Response:
SELECT "Score" FROM table_62112 WHERE "Country" = 'united states' AND "Place" = 't3' AND "Player" = 'phil blackmar'
### Instruction: What were the Lyrics (l) and Music (m) for the Artist who was in a Position higher than 3 and who earned 1st Place? ### Response:
SELECT "Lyrics (l) / Music (m)" FROM table_43270 WHERE "Position" > '3' AND "Place" = '1st'
### Instruction: What is the sum of all values in Fall 09 in Allegany county with Fall 07 less than 751? ### Response:
SELECT SUM("Fall 09") FROM table_5188 WHERE "Maryland Counties" = 'allegany' AND "Fall 07" < '751'
### Instruction: provide the long title of diagnoses and short title of procedure for patient with patient id 23733. ### Response:
SELECT diagnoses.long_title, procedures.short_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "23733"
### Instruction: provide the number of patients less than 68 years who had sodium lab test done. ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "68" AND lab.label = "Sodium"
### Instruction: WHAT IS THE NUMBER OF LOSSES WITH A LONG SMALLER THAN 24, AND GAIN BIGGER THAN 116? ### Response:
SELECT COUNT("Loss") FROM table_46164 WHERE "Long" < '24' AND "Gain" > '116'