instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
what are the three most frequently performed procedures for patients who previously received oxygen therapy (40% to 60%) - reduce fio2 as tolerated within 2 months in the previous year? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitsta... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'oxygen therapy (40% to 60%) - reduce fio... |
Return a pie chart on what are the number of rooms for each bed type? | CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER)CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT) | SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType |
Plot the total number by grouped by time of day as a bar graph, rank in ascending by the total number. | CREATE TABLE broadcast_share (Channel_ID int,Program_ID int,Date text,Share_in_percent real)CREATE TABLE program (Program_ID int,Name text,Origin text,Launch real,Owner text)CREATE TABLE broadcast (Channel_ID int,Program_ID int,Time_of_day text)CREATE TABLE channel (Channel_ID int,Name text,Owner text,Share_in_percent ... | SELECT Time_of_day, COUNT(*) FROM broadcast GROUP BY Time_of_day ORDER BY COUNT(*) |
In Penney's game what is the probability where the 1st player wins if the probability of a draw is 8.28% and the 2nd player chooses B BR? | CREATE TABLE table_16226 ("1st players choice" text,"2nd players choice" text,"Probability 1st player wins" text,"Probability 2nd player wins" text,"Probability of a draw" text) | SELECT "Probability 1st player wins" FROM table_16226 WHERE "Probability of a draw" = '8.28%' AND "2nd players choice" = 'B BR' |
How many family friendly games are in the 1990s? | CREATE TABLE table_14160327_4 (family_friendly VARCHAR,decade VARCHAR) | SELECT COUNT(family_friendly) FROM table_14160327_4 WHERE decade = "1990s" |
What is the Height of Junior Meghan Austin? | CREATE TABLE table_name_59 (height VARCHAR,year VARCHAR,name VARCHAR) | SELECT height FROM table_name_59 WHERE year = "junior" AND name = "meghan austin" |
What position is Sal Martinez? | CREATE TABLE table_name_32 (position VARCHAR,player VARCHAR) | SELECT position FROM table_name_32 WHERE player = "sal martinez" |
provide the number of patients whose admission year is less than 2167 and procedure icd9 code is 3532? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2167" AND procedures.icd9_code = "3532" |
How many matches were there in the round with 1,000,000 in prize money? | CREATE TABLE table_55269 ("Round" text,"Date" text,"Matches" real,"Clubs" text,"New entries this round" text,"Prize money" text) | SELECT COUNT("Matches") FROM table_55269 WHERE "Prize money" = '£1,000,000' |
Name the highest grid for Laps more than 137 and rank is less than 8 | CREATE TABLE table_name_89 (grid INTEGER,laps VARCHAR,rank VARCHAR) | SELECT MAX(grid) FROM table_name_89 WHERE laps > 137 AND rank < 8 |
What role was nominated at the Sydney Film Festival? | CREATE TABLE table_name_56 (role VARCHAR,festival_organization VARCHAR) | SELECT role FROM table_name_56 WHERE festival_organization = "sydney film festival" |
Name the rank on channel for pilot | CREATE TABLE table_26688 ("Episode number Production number" text,"Title" text,"Original airdate" text,"Time of airing" text,"Total viewers on Hallmark" real,"Total viewers on Hallmark+1" real,"Total viewers" real,"Rank on channel" text) | SELECT "Rank on channel" FROM table_26688 WHERE "Title" = 'Pilot' |
Who is the Opponent playing at 20:00 GMT at Camp Nou? | CREATE TABLE table_name_64 (opponent VARCHAR,time VARCHAR,ground VARCHAR) | SELECT opponent FROM table_name_64 WHERE time = "20:00 gmt" AND ground = "camp nou" |
how many patients died after being diagnosed with dmii wo cmp nt st uncntr during the same hospital encounter since 6 years ago? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost nu... | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime, t1.hadm_id FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FRO... |
Which Blackpool has a Preston North End smaller than 46, and a Competition of other, and a Draw larger than 1? | CREATE TABLE table_name_94 (blackpool INTEGER,draw VARCHAR,preston_north_end VARCHAR,competition VARCHAR) | SELECT SUM(blackpool) FROM table_name_94 WHERE preston_north_end < 46 AND competition = "other" AND draw > 1 |
what is patient 006-36108's first urine catheter output time on last month/30? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicm... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-36108')) AND intakeoutput.cellpath LIKE '%output%... |
What is the team's record when the NY rangers are at home with atlanta visting and lehtonen getting the decision? | CREATE TABLE table_name_25 (record VARCHAR,home VARCHAR,decision VARCHAR,visitor VARCHAR) | SELECT record FROM table_name_25 WHERE decision = "lehtonen" AND visitor = "atlanta" AND home = "ny rangers" |
when was last the heartrate of patient 030-52327 measured today? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweigh... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52327')) AND NOT vitalperiodic.heartrate IS NUL... |
what was the average systemicmean on the last icu visit for patient 031-4987. | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender t... | SELECT AVG(vitalperiodic.systemicmean) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4987') AND NOT patient.unitdischargetime IS N... |
For the headstamp id of h2, what was the color of the bullet tip? | CREATE TABLE table_16081 ("Headstamp ID" text,"Primer Annulus Color" text,"Bullet Tip Color" text,"Other Features" text,"Functional Type" text) | SELECT "Bullet Tip Color" FROM table_16081 WHERE "Headstamp ID" = 'H2' |
what is the rank (night) when the rating is more than 4.3 and the viewers (millions) is more than 10.72? | CREATE TABLE table_54456 ("Episode" text,"Rating" real,"Share" real,"Rating/Share (18-49)" text,"Viewers (millions)" real,"Rank (timeslot)" real,"Rank (night)" real,"Rank (week)" text) | SELECT AVG("Rank (night)") FROM table_54456 WHERE "Rating" > '4.3' AND "Viewers (millions)" > '10.72' |
What are the different card types, and how many cards are there of each, I want to order total number in descending order. | CREATE TABLE Customers_Cards (card_id INTEGER,customer_id INTEGER,card_type_code VARCHAR(15),card_number VARCHAR(80),date_valid_from DATETIME,date_valid_to DATETIME,other_card_details VARCHAR(255))CREATE TABLE Accounts (account_id INTEGER,customer_id INTEGER,account_name VARCHAR(50),other_account_details VARCHAR(255))C... | SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code ORDER BY COUNT(*) DESC |
Which College/junior/club team has a Round of 4? | CREATE TABLE table_13766 ("Round" real,"Pick" real,"Player" text,"Nationality" text,"College/junior/club team" text) | SELECT "College/junior/club team" FROM table_13766 WHERE "Round" = '4' |
Tell mem the opponent for result of w 31-21 | CREATE TABLE table_name_52 (opponent VARCHAR,result VARCHAR) | SELECT opponent FROM table_name_52 WHERE result = "w 31-21" |
How many viewers in millions watched the episode with the production code 6acx16? | CREATE TABLE table_24859 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text) | SELECT "U.S. viewers (million)" FROM table_24859 WHERE "Production code" = '6ACX16' |
What is the pick number for the tight end who was picked after round 6? | CREATE TABLE table_name_67 (pick VARCHAR,round VARCHAR,position VARCHAR) | SELECT COUNT(pick) FROM table_name_67 WHERE round > 6 AND position = "tight end" |
when did patient 035-6788 receive the last test of a lab? | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-6788')) ORDER BY lab.labresulttime DESC LIMIT 1 |
What was the episode number for the episode viewed by 5.68 million viewers? | CREATE TABLE table_30166 ("Series episode" real,"Season episode" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (in million)" text) | SELECT "Season episode" FROM table_30166 WHERE "U.S. viewers (in million)" = '5.68' |
what's the name of the diagnosis that patient 006-80884 was given for the last time since 2105? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunit... | SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-80884')) AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105... |
What is the smallest number of extra points? | CREATE TABLE table_3283 ("Player" text,"Position" text,"Starter" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Points" real) | SELECT MIN("Extra points") FROM table_3283 |
Who had the women's win when Norway was the winner overall in season 2001/02? | CREATE TABLE table_name_68 (winner VARCHAR,season VARCHAR) | SELECT winner AS Women FROM table_name_68 WHERE winner = "norway" AND season = "2001/02" |
Find the names of all races held in 2017. | CREATE TABLE driverstandings (driverstandingsid number,raceid number,driverid number,points number,position number,positiontext text,wins number)CREATE TABLE qualifying (qualifyid number,raceid number,driverid number,constructorid number,number number,position number,q1 text,q2 text,q3 text)CREATE TABLE drivers (driver... | SELECT name FROM races WHERE year = 2017 |
Which language do 87.5% of males speak? | CREATE TABLE table_name_44 (males VARCHAR,percentage___percentage_ VARCHAR) | SELECT males FROM table_name_44 WHERE percentage___percentage_ = "87.5" |
Which height is associated with Franklin High School? | CREATE TABLE table_77980 ("Player" text,"Height" text,"School" text,"Hometown" text,"College" text,"NBA Draft" text) | SELECT "Height" FROM table_77980 WHERE "School" = 'franklin high school' |
Name the prize pool for 706 (481 r, 346 a) | CREATE TABLE table_3260 ("Date" text,"Time (ET)" text,"Event #" real,"Event" text,"Winner" text,"Prize" text,"Entries" text,"Prize Pool" text,"Elapsed Time" text) | SELECT "Prize Pool" FROM table_3260 WHERE "Entries" = '706 (481 R, 346 A)' |
What is the total enrollment for the school in garden city, new york? | CREATE TABLE table_1969634_1 (enrollment VARCHAR,location VARCHAR) | SELECT enrollment FROM table_1969634_1 WHERE location = "Garden City, New York" |
How many points did the bills score when their opponent had 14 | CREATE TABLE table_20494 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Bills points" real,"Opponents" real,"Bills first downs" real,"Record" text) | SELECT "Bills points" FROM table_20494 WHERE "Opponents" = '14' |
Where does the judge who serves Beacon Falls , Naugatuck , Middlebury , Prospect reside? | CREATE TABLE table_26758262_1 (judges_residence VARCHAR,municipalities_served VARCHAR) | SELECT judges_residence FROM table_26758262_1 WHERE municipalities_served = "Beacon Falls , Naugatuck , Middlebury , Prospect" |
Who did the Blue Jays lose to on July 16? | CREATE TABLE table_14606 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Record" text) | SELECT "Loss" FROM table_14606 WHERE "Date" = 'july 16' |
Draw a bar chart about the distribution of date_address_from and the sum of monthly_rental bin date_address_from by time. | CREATE TABLE Behavior_Incident (incident_id INTEGER,incident_type_code VARCHAR(10),student_id INTEGER,date_incident_start DATETIME,date_incident_end DATETIME,incident_summary VARCHAR(255),recommendations VARCHAR(255),other_details VARCHAR(255))CREATE TABLE Ref_Address_Types (address_type_code VARCHAR(15),address_type_d... | SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC |
Who is the captain of Middlesbrough? | CREATE TABLE table_79810 ("Club" text,"Manager" text,"Captain" text,"Manufacturer" text,"Sponsor" text) | SELECT "Captain" FROM table_79810 WHERE "Club" = 'middlesbrough' |
What is the Date with a Home that is hamilton wildcats? | CREATE TABLE table_75857 ("Date" text,"Time" text,"Home" text,"Away" text,"Score" text,"Ground" text) | SELECT "Date" FROM table_75857 WHERE "Home" = 'hamilton wildcats' |
What venue is the home field of Richmond? | CREATE TABLE table_name_46 (venue VARCHAR,home_team VARCHAR) | SELECT venue FROM table_name_46 WHERE home_team = "richmond" |
What Venue has an Away Team Score of 9.12 (66)? | CREATE TABLE table_57423 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Venue" FROM table_57423 WHERE "Away team score" = '9.12 (66)' |
What is the sum of March, when Score is '2 - 2', and when Game is greater than 67? | CREATE TABLE table_9969 ("Game" real,"March" real,"Opponent" text,"Score" text,"Record" text) | SELECT SUM("March") FROM table_9969 WHERE "Score" = '2 - 2' AND "Game" > '67' |
yankee stadium (i), and a Time of 3:00 has what attendance for this location? | CREATE TABLE table_79861 ("Game" real,"Date" text,"Location" text,"Time" text,"Attendance" real) | SELECT "Attendance" FROM table_79861 WHERE "Location" = 'yankee stadium (i)' AND "Time" = '3:00' |
What Engine had a Finish of 27? | CREATE TABLE table_67021 ("Year" real,"Chassis" text,"Engine" text,"Start" text,"Finish" text,"Entrant" text) | SELECT "Engine" FROM table_67021 WHERE "Finish" = '27' |
Name the average total for gold less than 1 and rank less than 5 | CREATE TABLE table_70364 ("Rank" real,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT AVG("Total") FROM table_70364 WHERE "Gold" < '1' AND "Rank" < '5' |
tell me the price of a vancomycin - trough lab test? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid number,lab... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'vancomycin - trough') |
What was the location and it's corresponding attendance during the game against Los Angeles? | CREATE TABLE table_30049462_4 (location_attendance VARCHAR,team VARCHAR) | SELECT location_attendance FROM table_30049462_4 WHERE team = "Los Angeles" |
Latest activity across all sites.. | CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance... | SELECT DisplayName, ProfileImageUrl FROM Users WHERE DisplayName LIKE '%M%' AND ProfileImageUrl != '' |
how many people attended the game in november against sunderland ? | CREATE TABLE table_204_318 (id number,"date" text,"opponent" text,"venue" text,"result" text,"attendance" number,"scorers" text) | SELECT "attendance" FROM table_204_318 WHERE "date" = 11 AND "opponent" = 'sunderland' |
For those records from the products and each product's manufacturer, show me about the distribution of name and the average of code , and group by attribute name in a bar chart, and order total number in descending order please. | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code DESC |
What Player has a To par of 2? | CREATE TABLE table_61671 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Player" FROM table_61671 WHERE "To par" = '–2' |
Are any other requirements fulfilled for POLISH 432 besides general elective ? | CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit i... | SELECT DISTINCT program_course.category FROM course, program_course WHERE course.department = 'POLISH' AND course.number = 432 AND program_course.course_id = course.course_id |
Which located featured the first prize of 33500? | CREATE TABLE table_16966 ("Date" text,"Tournament" text,"Location" text,"Purse($)" real,"Winner" text,"Score" text,"1st Prize($)" real) | SELECT "Location" FROM table_16966 WHERE "1st Prize( $ )" = '33500' |
What is the queens where richmond staten is 42%? | CREATE TABLE table_16449 ("1973 Democratic initial primary" text,"Manhattan" text,"The Bronx" text,"Brooklyn" text,"Queens" text,"Richmond [Staten Is.]" text,"Total" real,"%" text) | SELECT "Queens" FROM table_16449 WHERE "Richmond [Staten Is.]" = '42%' |
What's the tie number of Chelsea when they were home? | CREATE TABLE table_63326 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Tie no" FROM table_63326 WHERE "Home team" = 'chelsea' |
What is the round of the pf position player from 1996 and the college/high school/club mississippi state? | CREATE TABLE table_50038 ("Year" real,"Round" text,"Player" text,"Nationality" text,"Position" text,"College/High School/Club" text) | SELECT "Round" FROM table_50038 WHERE "Position" = 'pf' AND "Year" = '1996' AND "College/High School/Club" = 'mississippi state' |
How many date of appointment entries are there when the team is khazar lankaran? | CREATE TABLE table_29285 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text) | SELECT COUNT("Date of appointment") FROM table_29285 WHERE "Team" = 'Khazar Lankaran' |
For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by weekday, I want to show by the the average of employee id in asc. | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL... | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(EMPLOYEE_ID) |
Where is the school with state authority that has a roll of more than 157 students? | CREATE TABLE table_80078 ("Name" text,"Years" text,"Gender" text,"Area" text,"Authority" text,"Decile" real,"Roll" real) | SELECT "Area" FROM table_80078 WHERE "Authority" = 'state' AND "Roll" > '157' |
Who are the finals opponents for the match with partner Ricardo Hocevar? | CREATE TABLE table_name_44 (opponents_in_the_final VARCHAR,partnering VARCHAR) | SELECT opponents_in_the_final FROM table_name_44 WHERE partnering = "ricardo hocevar" |
what is the only nation to receive three gold medals ? | CREATE TABLE table_204_775 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "nation" FROM table_204_775 WHERE "gold" = 3 |
get me the long title of diagnoses and primary disease of patient betty campbell. | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT demographic.diagnosis, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Betty Campbell" |
What kind of Republican ticket has a Prohibition ticket of stephen mead wing? | CREATE TABLE table_name_27 (republican_ticket VARCHAR,prohibition_ticket VARCHAR) | SELECT republican_ticket FROM table_name_27 WHERE prohibition_ticket = "stephen mead wing" |
Who drove the fastest lap at the Tenneco Automotive Grand Prix of Detroit? | CREATE TABLE table_16429 ("Rnd" real,"Race Name" text,"Pole position" text,"Fastest lap" text,"Winning driver" text,"Winning team" text,"Report" text) | SELECT "Fastest lap" FROM table_16429 WHERE "Race Name" = 'Tenneco Automotive Grand Prix of Detroit' |
Tags Without Excerpt or Wiki (unbalanced). | CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text... | SELECT c.TagName, c.CountPosts AS "Number of Posts", e.Body AS "Excerpt", w.Body AS "Wiki" FROM (SELECT t.TagName, t.ExcerptPostId, t.WikiPostId, COUNT(*) AS CountPosts FROM Tags AS t LEFT OUTER JOIN TagSynonyms AS s ON (t.TagName = s.SourceTagName) INNER JOIN PostTags AS p ON (p.TagId = t.Id) WHERE s.ApprovalDate IS N... |
Which team was the visitor when Milt Palacio (15) was the leading scorer? | CREATE TABLE table_name_82 (visitor VARCHAR,leading_scorer VARCHAR) | SELECT visitor FROM table_name_82 WHERE leading_scorer = "milt palacio (15)" |
Name the points for 212 respect toward opponents | CREATE TABLE table_226619_12 (points VARCHAR,respect_toward_opponents VARCHAR) | SELECT points FROM table_226619_12 WHERE respect_toward_opponents = 212 |
what is the number of patients whose diagnoses short title is mv collision nos-driver and drug route is id? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Mv collision NOS-driver" AND prescriptions.route = "ID" |
What is the race in the 8th position? | CREATE TABLE table_76307 ("Season" text,"Series" text,"Team Name" text,"Races" real,"Wins" real,"Poles" real,"F.L." real,"Podiums" real,"Points" text,"Position" text) | SELECT "Races" FROM table_76307 WHERE "Position" = '8th' |
What was the pick number for the wide receiver drafted from Michigan State? | CREATE TABLE table_43314 ("Pick #" real,"NFL Team" text,"Player" text,"Position" text,"College" text) | SELECT "Pick #" FROM table_43314 WHERE "Position" = 'wide receiver' AND "College" = 'michigan state' |
What's the report for the race name, XIII Grand Prix de l'Albigeois? | CREATE TABLE table_1140117_5 (report VARCHAR,race_name VARCHAR) | SELECT report FROM table_1140117_5 WHERE race_name = "XIII Grand Prix de l'Albigeois" |
What Country is Rocco Mediate from? | CREATE TABLE table_46750 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Country" FROM table_46750 WHERE "Player" = 'rocco mediate' |
What date did the episode with a production code of 3x6316 originally air? | CREATE TABLE table_28116528_1 (original_air_date VARCHAR,production_code VARCHAR) | SELECT original_air_date FROM table_28116528_1 WHERE production_code = "3X6316" |
What was the lowest attendance at a game when Pittsburgh was the home team? | CREATE TABLE table_name_68 (attendance INTEGER,home VARCHAR) | SELECT MIN(attendance) FROM table_name_68 WHERE home = "pittsburgh" |
How many viewers in the UK did episode 50 have? | CREATE TABLE table_31528 ("Episode no." real,"US Airdate" text,"US Total viewers" text,"UK Airdate" text,"UK Total viewers" text) | SELECT "UK Total viewers" FROM table_31528 WHERE "Episode no." = '50' |
How many users have a location in their profile. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score nu... | SELECT HasLocation, COUNT(*) FROM (SELECT Id AS "user_link", CASE WHEN Location IS NULL THEN 'No' ELSE 'Yes' END AS HasLocation FROM Users) AS t GROUP BY HasLocation |
Name the recopa sudamericana 1992 for did not qualify for libertadores 1992 and round of 16 for bragantino | CREATE TABLE table_1165 ("Team" text,"Copa Libertadores 1992" text,"Supercopa Sudamericana 1992" text,"Copa CONMEBOL 1992" text,"Recopa Sudamericana 1992" text,"Intercontinental Cup 1992" text) | SELECT "Recopa Sudamericana 1992" FROM table_1165 WHERE "Copa Libertadores 1992" = 'Did not qualify' AND "Copa CONMEBOL 1992" = 'Round of 16' AND "Team" = 'Bragantino' |
Questions with negative score favorited only by the OP. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId numbe... | SELECT Posts.Id AS "post_link", Posts.FavoriteCount, Posts.Score, Posts.CreationDate, Votes.UserId AS "user_link" FROM Votes JOIN Posts ON (Posts.Id = Votes.PostId) WHERE Posts.FavoriteCount = 1 AND Posts.Score < 0 AND VoteTypeId = 5 AND Posts.PostTypeId = 1 AND Posts.OwnerUserId = Votes.UserId ORDER BY Posts.CreationD... |
Name the opponent when the result is w 16-15 and has home/away of home | CREATE TABLE table_name_37 (opponent VARCHAR,home_away VARCHAR,result VARCHAR) | SELECT opponent FROM table_name_37 WHERE home_away = "home" AND result = "w 16-15" |
What are the notes for Happy Camp? | CREATE TABLE table_name_79 (notes VARCHAR,title VARCHAR) | SELECT notes FROM table_name_79 WHERE title = "happy camp" |
What is the smallest frequency (kHz) that is in the location of Longview? | CREATE TABLE table_36968 ("Frequency (kHz)" real,"Call letters" text,"Licensed location" text,"Type" text,"Format" text) | SELECT MIN("Frequency (kHz)") FROM table_36968 WHERE "Licensed location" = 'longview' |
What was Raymond Floyd's score? | CREATE TABLE table_8818 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Score" FROM table_8818 WHERE "Player" = 'raymond floyd' |
What's the score for a game over 56 with a record of 29-24-7 with a lundqvist decision? | CREATE TABLE table_name_18 (score VARCHAR,record VARCHAR,game VARCHAR,decision VARCHAR) | SELECT score FROM table_name_18 WHERE game > 56 AND decision = "lundqvist" AND record = "29-24-7" |
List the names of all distinct wines ordered by price. | CREATE TABLE WINE (Name VARCHAR,price VARCHAR) | SELECT DISTINCT Name FROM WINE ORDER BY price |
What tournament had an opponent of Els Callens Nancy Feber? | CREATE TABLE table_name_95 (tournament VARCHAR,opponents_in_the_final VARCHAR) | SELECT tournament FROM table_name_95 WHERE opponents_in_the_final = "els callens nancy feber" |
What school/club team is Trey Johnson on? | CREATE TABLE table_10015132_9 (school_club_team VARCHAR,player VARCHAR) | SELECT school_club_team FROM table_10015132_9 WHERE player = "Trey Johnson" |
What's the 2nd leg result in the round where Panionios is team #2? | CREATE TABLE table_19130829_4 (team__number2 VARCHAR) | SELECT 2 AS nd_leg FROM table_19130829_4 WHERE team__number2 = "Panionios" |
When the share of votes equals 21.8%, what's the sum of the total amount of seats? | CREATE TABLE table_name_61 (total_seats INTEGER,share_of_votes VARCHAR) | SELECT SUM(total_seats) FROM table_name_61 WHERE share_of_votes = "21.8%" |
Calculate the total number of patients who had icd9 code v1006 and a duration of stay in hospital of more than 17 days | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "17" AND diagnoses.icd9_code = "V1006" |
what was the total population in 1801 ? | CREATE TABLE table_204_938 (id number,"year" number,"edmonton\nhundred" number,"elthorne\nhundred" number,"gore\nhundred" number,"isleworth\nhundred" number,"ossulstone\nhundred\nholborn\ndivision" number,"ossulstone\nhundred\nfinsbury\ndivision" number,"ossulstone\nhundred\nkensington\ndivision" number,"ossulstone\nhu... | SELECT "total" FROM table_204_938 WHERE "year" = 1801 |
What's the number & name for the date after 1954? | CREATE TABLE table_name_28 (number_ VARCHAR,_name VARCHAR,date INTEGER) | SELECT number_ & _name FROM table_name_28 WHERE date > 1954 |
during this year was patient 009-10007 prescribed pantoprazole sodium 40 mg po tbec? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-10007')) AND medication.drugname = 'pantoprazole sodium 40 mg po tbec'... |
What was the attendance in week 6? | CREATE TABLE table_33181 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT "Attendance" FROM table_33181 WHERE "Week" = '6' |
provide the number of patients whose insurance is private and lab test name is bilirubin, indirect? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Private" AND lab.label = "Bilirubin, Indirect" |
what is the name of the treatment that patient 006-43795 had been given two times during the first hospital encounter? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE treatment (treatmentid number,patientun... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... |
Which player's home town is Swift Current, AB? | CREATE TABLE table_67030 ("Number" text,"Player" text,"Position" text,"Height" text,"Weight" text,"Home Town" text) | SELECT "Player" FROM table_67030 WHERE "Home Town" = 'swift current, ab' |
systolic blood pressure ( supine ) >= 100 mmhg; | CREATE TABLE table_train_83 ("id" int,"systolic_blood_pressure_sbp" int,"renal_disease" bool,"diabetic" string,"estimated_glomerular_filtration_rate_egfr" int,"iq" int,"geriatric_depression_scale_gds" int,"NOUSE" float) | SELECT * FROM table_train_83 WHERE systolic_blood_pressure_sbp >= 100 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.