instruction
stringlengths
57
490
output
stringlengths
69
1.29k
### 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: what is the number of medicare patients who had clofarabine intravenous infusion? ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicare" AND procedures.short_title = "IV infusion clofarabine"
### Instruction: count the number of patients whose insurance is private and procedure short title is spinal canal explor nec? ### 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 = "Spinal canal explor NEC"
### Instruction: Give me a stacked bar chart to show how many things in different types of each thing, and the details of the organization that owns it. ### Response:
SELECT organization_details, COUNT(organization_details) FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id GROUP BY Type_of_Thing_Code, organization_details
### Instruction: What are the titles and ids for albums containing tracks with unit price greater than 1, and show in descending by the total number please. ### Response:
SELECT T1.Title, T1.AlbumId FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1 ORDER BY T1.AlbumId DESC
### Instruction: What is the last name of the professor whose office is located in DRE 102, and when were they hired? ### Response:
SELECT T1.emp_lname, T1.emp_hiredate FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num WHERE T2.prof_office = 'DRE 102'
### Instruction: Which departments have the top 3 highest number of students? Show the department address and number of students with a pie chart. ### Response:
SELECT DEPT_ADDRESS, COUNT(*) FROM STUDENT AS T1 JOIN DEPARTMENT AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.DEPT_CODE ORDER BY COUNT(*) DESC LIMIT 3
### Instruction: Visualize a bar chart for how many assets can each parts be used in? List the part name and the number, and display X in descending order. ### Response:
SELECT part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY part_name DESC
### Instruction: when did patient 65569 come in 2105 for the last time to the hospital? ### Response:
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 65569 AND STRFTIME('%y', admissions.admittime) = '2105' ORDER BY admissions.admittime DESC LIMIT 1
### Instruction: How much 2005 has a 2006 larger than 4,67, and a 2004 of -14,76? ### Response:
SELECT COUNT("2005") FROM table_60236 WHERE "2006" > '4,67' AND "2004" = '-14,76'
### Instruction: calculate the total number of private patients diagnosed with schizoaffective dis nos. ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Private" AND diagnoses.short_title = "Schizoaffective dis NOS"
### Instruction: A line chart for what are the number of the dates in which the mean sea level pressure was between 303 and 31?, and I want to display date from low to high order. ### Response:
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 GROUP BY date ORDER BY date
### Instruction: Which Village has a Region of C te De Nuits, Wine Styles of Red Wine, and a Grand Cru of Latrici res-Chambertin? ### Response:
SELECT village FROM table_name_57 WHERE region = "côte de nuits" AND wine_style = "red wine" AND grand_cru = "latricières-chambertin"
### Instruction: If the velocity angle is ln[(1 + 5)/2] 0.481, what is the condition/parameter? ### Response:
SELECT condition_parameter FROM table_15314901_1 WHERE velocity_angle_η_in_i_radians = "ln[(1 + √5)/2] ≅ 0.481"
### Instruction: Name the first elected for hosea moffitt (f) 57.9% josiah masters (dr) 42.1% ### Response:
SELECT "First elected" FROM table_74004 WHERE "Candidates" = 'Hosea Moffitt (F) 57.9% Josiah Masters (DR) 42.1%'
### Instruction: What murder (2012) rate per 100,00 also has a 1.616 as the peace (2012) GPI? ### Response:
SELECT murder__2012__rate_per_100, 000 FROM table_name_26 WHERE peace__2012__gpi = 1.616
### Instruction: what number of patients admitted in urgent care had their route mentioned as ivpca? ### 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.route = "IVPCA"
### Instruction: What is the population when the Per capita income of $18,884, and a Number of households smaller than 14,485? ### Response:
SELECT SUM(population) FROM table_name_98 WHERE per_capita_income = "$18,884" AND number_of_households < 14 OFFSET 485
### Instruction: What is the most points 1 when the goals against are fewer than 97, lost less than 22, 9 draws and goal difference of +28? ### Response:
SELECT MAX(points_1) FROM table_name_57 WHERE goals_against < 97 AND lost < 22 AND drawn = 9 AND goal_difference = "+28"
### Instruction: Who Votes to Close, Reopen, Delete, Undelete the Most?. ### Response:
SELECT v.* FROM Users AS u INNER JOIN Votes AS v ON u.Id = v.UserId WHERE u.Id = '##UserId:int##' AND v.VoteTypeId IN (6, 7, 10, 11) ORDER BY v.VoteTypeId
### Instruction: what is the number of patients whose age is less than 89 and item id is 50953? ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "89" AND lab.itemid = "50953"
### Instruction: what was the result of the next game after the date of january 15 , 1954 ? ### Response:
SELECT "result" FROM table_204_329 WHERE "date" > (SELECT "date" FROM table_204_329 WHERE "date" = '15 january 1954') ORDER BY "date" LIMIT 1
### Instruction: give me the number of patients of white ethnicity diagnosed for retained plastic fragments. ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.short_title = "Retain plastic fragments"
### Instruction: What is the Outcome of the match with Partner Marcella Mesker and a Score of 6 4, 4 6, 4 6? ### Response:
SELECT "Outcome" FROM table_61217 WHERE "Partner" = 'marcella mesker' AND "Score" = '6–4, 4–6, 4–6'
### Instruction: Provide the number of patients admitted to the hospital before the year 2115 whose primary disease is gastrointestinal bleed. ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "GASTROINTESTINAL BLEED" AND demographic.admityear < "2115"
### Instruction: A bar chart for showing the number of the facility codes of apartments with more than 4 bedrooms. ### Response:
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code
### Instruction: Users who start questions with 'So ...'. ### Response:
SELECT p.Id AS "post_link" FROM Posts AS p JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.PostTypeId = 2 AND p.OwnerUserId = '##UserId:int##' AND UPPER(p.Body) LIKE UPPER('%##CommentText##%')
### Instruction: just count the number of patients who had been prescribed oxycodone-acetaminophen. ### Response:
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'oxycodone-acetaminophen')
### Instruction: how many female patients were prescribed the drug quetiapine fumarate? ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.drug = "Quetiapine Fumarate"
### Instruction: For those records from the products and each product's manufacturer, find name and the average of revenue , and group by attribute name, and visualize them by a bar chart. ### Response:
SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
### Instruction: What was the sum of Revenue ($M), when the Debt as % of value was higher than 27, and the Operating income($m) was 77? ### Response:
SELECT SUM("Revenue ($M)") FROM table_71279 WHERE "Debt as %of value" > '27' AND "Operating income($m)" = '77'
### Instruction: What is Outcome, when Partner is 'Byron Black', and when Opponents is 'Goran Ivani evi Brian Macphie'? ### Response:
SELECT "Outcome" FROM table_48856 WHERE "Partner" = 'byron black' AND "Opponents" = 'goran ivanišević brian macphie'
### Instruction: provide the number of male patients whose drug code is mido5. ### 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 = "MIDO5"
### Instruction: How much 1969 has a 1967 smaller than 0.73, and a 1964 larger than 0.07? ### Response:
SELECT COUNT("1969") FROM table_64934 WHERE "1967" < '0.73' AND "1964" > '0.07'
### Instruction: What displacement is the model in 1999 with a Torque of 280n m (207lb ft) @ 1750? ### Response:
SELECT displacement FROM table_name_61 WHERE year = 1999 AND torque = "280n·m (207lb·ft) @ 1750"
### Instruction: What is the lowest January, when Game is less than 46, when Score is '5 - 3', and when Record is '15-22-8'? ### Response:
SELECT MIN(january) FROM table_name_94 WHERE game < 46 AND score = "5 - 3" AND record = "15-22-8"
### Instruction: What laps have a rank larger than 13 and the Time/Retired is accident, and a Qual smaller than 136.98? ### Response:
SELECT "Laps" FROM table_56486 WHERE "Rank" > '13' AND "Time/Retired" = 'accident' AND "Qual" < '136.98'
### Instruction: Questions with No Accepted Answer by Tag. ### Response:
SELECT TagName, COUNT(TagName) FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE PostTypeId = 1 AND AcceptedAnswerId IS NULL AND NOT ClosedDate IS NULL GROUP BY TagName ORDER BY COUNT(TagName) DESC
### Instruction: how many patients who had rdw lab test left against medical advice? ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND lab.label = "RDW"
### Instruction: What is the Year commissioned of the power station with a Gross head of 60 metres and Average annual output of less than 59 million KWh? ### Response:
SELECT MAX(year_commissioned) FROM table_name_75 WHERE gross_head__metres_ = 60 AND average_annual_output__million_kwh_ < 59
### Instruction: Show all cities along with the number of drama workshop groups in each city with a bar chart, show in asc by the the total number . ### Response:
SELECT City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town ORDER BY COUNT(*)
### Instruction: find out how many patients were discharged from the hospital during the previous year. ### Response:
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND DATETIME(patient.hospitaldischargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
### Instruction: For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and code , and group by attribute headquarter. ### Response:
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name
### Instruction: What was the Company or Product name where Entrepreneurs Geoff and Colette Bell requested 75,000? ### Response:
SELECT "Company or product name" FROM table_71893 WHERE "Money requested (\u00a3)" = '75,000' AND "Entrepreneur(s)" = 'geoff and colette bell'
### Instruction: When 7 april 2001 to 29 september 2001 was aired in japan 2 how many titles were there? ### Response:
SELECT COUNT(title) FROM table_1714685_1 WHERE aired_in_japan_3 = "7 April 2001 to 29 September 2001"
### Instruction: Users with most reputation from single post. ### Response:
SELECT p.OwnerUserId AS "user_link", u.Reputation FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id GROUP BY p.OwnerUserId, u.Reputation HAVING COUNT(p.Id) = 1 ORDER BY u.Reputation DESC LIMIT 100
### Instruction: For events that have more than one participant, count the event details for a bar chart, and list in ascending by the bars please. ### Response:
SELECT Event_Details, COUNT(Event_Details) FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY Event_Details ORDER BY Event_Details
### Instruction: What is the highest population in 1991 in Baden Bei Wien, and a 2007 population larger than 25,284? ### Response:
SELECT MAX(population_1991) FROM table_name_13 WHERE name = "baden bei wien" AND population_2007 > 25 OFFSET 284
### Instruction: Show the transaction type descriptions and dates if the share count is smaller than 10. ### Response:
SELECT T1.transaction_type_description, T2.date_of_transaction FROM ref_transaction_types AS T1 JOIN transactions AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10
### Instruction: What is the highest Km From Kingston, when Mi From Kingston is less than 108, and when Length Meters is 260.6? ### Response:
SELECT MAX("Km from Kingston") FROM table_9562 WHERE "Mi from Kingston" < '108' AND "Length meters" = '260.6'
### Instruction: What shows for 1987 when 1995 shows 1r, 1986 is a, and 1998 is sf? ### Response:
SELECT 1987 FROM table_name_47 WHERE 1995 = "1r" AND 1986 = "a" AND 1988 = "sf"
### Instruction: Bring the number of patients with elective hospital admission who had a joint fluid lab test. ### 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.fluid = "Joint Fluid"
### Instruction: List the number of courses in year 2008 for each instructor in a bar chart. ### Response:
SELECT name, COUNT(name) FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.ID = T3.ID WHERE year = 2008 GROUP BY name
### Instruction: Find all the papers published by 'Aaron Turon'. ### Response:
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Aaron" AND t1.lname = "Turon"
### Instruction: how many patients are married and tested with lab item id 50820? ### 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 = "50820"
### Instruction: What is the total number of Total Congregations, when % LDS is 0.54%, and when Population is greater than 105,275? ### Response:
SELECT COUNT("Total Congregations") FROM table_77479 WHERE "% LDS" = '0.54%' AND "Population" > '105,275'
### Instruction: Show me a bar chart about the number of races held in each year after 2014, I want to order y axis from low to high order please. ### Response:
SELECT year, COUNT(year) FROM races AS T1 JOIN results AS T2 ON T1.raceId = T2.raceId WHERE T1.year > 2014 ORDER BY COUNT(year)
### Instruction: What is zip code of customer with first name as Carole and last name as Bernhard? ### Response:
SELECT T2.zip_postcode FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = "Carole" AND T1.last_name = "Bernhard"
### Instruction: which journal did Donald E Knuth publish his last paper ? ### Response:
SELECT DISTINCT paper.journalid, paper.year FROM author, paper, writes WHERE author.authorname = 'Donald E Knuth' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY paper.journalid, paper.year ORDER BY paper.year DESC
### Instruction: What is the highest Against where they lost less than 20 games, tied more than 2 of them, and they had Favour less than 11? ### Response:
SELECT MAX("Against") FROM table_45481 WHERE "Lost" < '20' AND "Draw" > '2' AND "Favour" < '11'
### Instruction: What is the lowest First Title, when All-Time is greater than 1, when Country is 'United States (USA)', and when Amateur Era is greater than 17? ### Response:
SELECT MIN(first_title) FROM table_name_13 WHERE all_time > 1 AND country = "united states (usa)" AND amateur_era > 17
### Instruction: On what date was the rd. time at 10 with Sammy Angott as an opponent with a record of 33 0? ### Response:
SELECT "Date" FROM table_6178 WHERE "Rd., Time" = '10' AND "Opponent" = 'sammy angott' AND "Record" = '33–0'
### Instruction: What is the total attendance with a Report of sd.hr, and a Score of 3 1, and a Date of 14 apr 2001? ### Response:
SELECT SUM(attendance) FROM table_name_22 WHERE report = "sd.hr" AND score = "3–1" AND date = "14 apr 2001"
### Instruction: according to this table , did mexico or italy have more ` friendly ' competitions against spain ? ### Response:
SELECT "opponent" FROM table_203_431 WHERE "opponent" IN ('mexico', 'italy') AND "competition" = 'friendly' GROUP BY "opponent" ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: What is the average Against when the drawn is more than 2 and the Difference of- 17, and a Played smaller than 20? ### Response:
SELECT AVG("Against") FROM table_6891 WHERE "Drawn" > '2' AND "Difference" = '- 17' AND "Played" < '20'
### Instruction: What is the lowest to par of a player from australia with a score of 76-70-75-72=293? ### Response:
SELECT MIN(to_par) FROM table_name_96 WHERE country = "australia" AND score = 76 - 70 - 75 - 72 = 293
### Instruction: What is Place, when To Par is less than 15, and when Score is 76-72-75-71=294? ### Response:
SELECT "Place" FROM table_8693 WHERE "To par" < '15' AND "Score" = '76-72-75-71=294'
### Instruction: what is the difference in rank between nancy pelosi and john boehner ? ### Response:
SELECT ABS((SELECT "rank" FROM table_203_409 WHERE "representative" = 'nancy pelosi') - (SELECT "rank" FROM table_203_409 WHERE "representative" = 'john boehner'))
### Instruction: Show all allergy type with number of students affected Visualize by bar chart, show in desc by the bars. ### Response:
SELECT AllergyType, COUNT(*) FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType ORDER BY AllergyType DESC
### Instruction: What was the Opponent on the game played on a Hard Surface with a Score of 3 6, 6 3, [7 10]? ### Response:
SELECT opponent_in_the_final FROM table_name_61 WHERE surface = "hard" AND score = "3–6, 6–3, [7–10]"
### Instruction: When a variant without niqqud is as middle letter: with a phonemic value of /v/, what is the variant with niqqud? ### Response:
SELECT variant__with_niqqud__ FROM table_name_53 WHERE phonemic_value = "/v/" AND without_niqqud = "as middle letter: וו"
### Instruction: How many laps with a grid larger than 7 did a Lotus - Ford do with a Time/Retired of + 2 laps? ### Response:
SELECT SUM("Laps") FROM table_58534 WHERE "Grid" > '7' AND "Constructor" = 'lotus - ford' AND "Time/Retired" = '+ 2 laps'
### Instruction: For those records from the products and each product's manufacturer, a bar chart shows the distribution of headquarter and the average of price , and group by attribute headquarter. ### Response:
SELECT Headquarter, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
### Instruction: What is the average cost of procedures that physician John Wen was trained in? ### Response:
SELECT AVG(T3.cost) FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = "John Wen"
### Instruction: What is the least value for total population in 2001 with a growth rate in 1991-01 of 33.08? ### Response:
SELECT MIN("Total Population 2001") FROM table_23094 WHERE "Growth Rate 1991-01" = '33.08'
### Instruction: Which Constructor has a Grid smaller than 24, more than 77 laps, and a Driver of jean-pierre beltoise? ### Response:
SELECT "Constructor" FROM table_11679 WHERE "Grid" < '24' AND "Laps" > '77' AND "Driver" = 'jean-pierre beltoise'
### Instruction: What was the reward when immunity went to martin and finish is 13th voted out 8th jury member day 46? ### Response:
SELECT "Reward" FROM table_27265 WHERE "Immunity" = 'Martin' AND "Finish" = '13th Voted Out 8th Jury Member Day 46'
### Instruction: What is the value for the byte string when the memory map, decimal, and floating points are all standard and the max memory is smaller than 512? ### Response:
SELECT byte_string FROM table_name_23 WHERE memory_map = "standard" AND decimal = "standard" AND floating_point = "standard" AND max_memory__kwords_ < 512
### Instruction: What's the total failures among rockets that had more than 3 successes, type ariane 5 and more than 0 partial failures? ### Response:
SELECT COUNT("Failures") FROM table_79770 WHERE "Successes" > '3' AND "Type" = 'ariane 5' AND "Partial failures" > '0'
### Instruction: Name the incumbent for candidates Joseph Hiester (dr) 83.2% Roswell Wells (f) 16.8%. ### Response:
SELECT incumbent FROM table_2668401_12 WHERE candidates = "Joseph Hiester (DR) 83.2% Roswell Wells (F) 16.8%"
### Instruction: What are the names, checking balances, and savings balances for all customers? ### Response:
SELECT T2.balance, T3.balance, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid
### Instruction: Which Runner-up has a Last win smaller than 1998, and Wins of 1, and a Rank larger than 13? ### Response:
SELECT COUNT("Runner-up") FROM table_37594 WHERE "Last win" < '1998' AND "Wins" = '1' AND "Rank" > '13'
### Instruction: which contest was held in the same site as the game versus western carolina ? ### Response:
SELECT "opponent" FROM table_204_436 WHERE "opponent" <> 'western carolina' AND "site" = (SELECT "site" FROM table_204_436 WHERE "opponent" = 'western carolina')
### Instruction: What camera has the highest Mpix with an aspect ratio of 2:1, a height less than 1536, and a width smaller than 2048? ### Response:
SELECT MAX(mpix) FROM table_name_51 WHERE aspect_ratio = "2:1" AND height < 1536 AND width < 2048
### Instruction: What season has esc holzkirchen south, esv buchloe west, and ehc bayreuth north? ### Response:
SELECT "Season" FROM table_50326 WHERE "South" = 'esc holzkirchen' AND "West" = 'esv buchloe' AND "North" = 'ehc bayreuth'
### Instruction: What is the average Barrow Island Australia when Draugen north sea is 17 and Mutineer-Exeter Australia is smaller than 6? ### Response:
SELECT AVG(barrow_island_australia) FROM table_name_94 WHERE draugen_north_sea = 17 AND mutineer_exeter_australia < 6
### Instruction: which kingdom contained the second most villages , next only to godara ? ### Response:
SELECT "name of kingdom" FROM table_203_713 WHERE "no. of villages" < (SELECT "no. of villages" FROM table_203_713 WHERE "name of kingdom" = 'godara') ORDER BY "no. of villages" DESC LIMIT 1
### Instruction: dyslipidemia, including triglycerides > 800 mg / dl, ldl > 200 mg / dl ### Response:
SELECT * FROM table_dev_20 WHERE dyslipidemia = 1 OR (triglyceride_tg > 800 OR ldl > 200)
### Instruction: how many patients having the procedure title other bronchoscopy were divorced? ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "DIVORCED" AND procedures.short_title = "Other bronchoscopy"
### Instruction: Top 5000 users from Roorkee. ### Response:
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%roorkee%' OR UPPER(Location) LIKE '%ROORKEE' ORDER BY Reputation DESC LIMIT 5000
### Instruction: count the number of patients whose admission location is transfer from hosp/extram and days of hospital stay is greater than 26? ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.days_stay > "26"
### Instruction: how many patients were admitted in emergency primarily for brain mass; intracranial hemorrhage ? ### Response:
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE"
### Instruction: What is the highest Cycle, when the Number of Constestants is 11, and when Premiere Date is September 3, 2012? ### Response:
SELECT MAX(cycle) FROM table_name_57 WHERE number_of_contestants = "11" AND premiere_date = "september 3, 2012"
### Instruction: what are patient 017-13959 hospital admission times since 5 years ago? ### Response:
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '017-13959' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-5 year')
### Instruction: Provide the number of self pay insurance patients who had vitamin b12 lab tests. ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Self Pay" AND lab.label = "Vitamin B12"
### Instruction: How many consecutive starts for the linebacker who played from 9/21/1975 12/16/1984? ### Response:
SELECT MAX(total) FROM table_28606933_7 WHERE period = "9/21/1975 – 12/16/1984"
### Instruction: Who is the lites 2 race two winning team when #11 Performance Tech is the lites 1 race two winning team? ### Response:
SELECT lites_2_race_two_winning_team FROM table_26638600_3 WHERE lites_1_race_two_winning_team = "#11 Performance Tech"
### Instruction: Top 50000 Users by Reputation. ### Response:
SELECT Users.Id, DisplayName, Reputation, COUNT(Posts.Id) AS Answers FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 2 GROUP BY Users.Id, DisplayName, Reputation ORDER BY Reputation DESC LIMIT 50000