instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
what are the five most commonly performed procedures for patients who have also received agent specific therapy previously during the same hospital visit,? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'agent... |
Can you tell me the sum of Podiums that has the Season of 2006, and the Races larger than 16? | CREATE TABLE table_name_20 (podiums INTEGER,season VARCHAR,races VARCHAR) | SELECT SUM(podiums) FROM table_name_20 WHERE season = "2006" AND races > 16 |
What is the Flattening ratio associated with the Equatorial diameter of 12,756.28km? | CREATE TABLE table_name_27 (flattening_ratio VARCHAR,equatorial_diameter VARCHAR) | SELECT flattening_ratio FROM table_name_27 WHERE equatorial_diameter = "12,756.28km" |
What catalog had an Epic Records label in CD format? | CREATE TABLE table_50737 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text) | SELECT "Catalog" FROM table_50737 WHERE "Label" = 'epic records' AND "Format" = 'cd' |
had patient 030-53416 ever had some output y (ml)-chest tube y - a #2 mid b #3 mid's since 118 months ago? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,... | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-53416')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu... |
For each document, list the number of employees who have showed up in the circulation history of that document. List the document ids and number of employees. | CREATE TABLE Circulation_History (document_id VARCHAR,employee_id VARCHAR) | SELECT document_id, COUNT(DISTINCT employee_id) FROM Circulation_History GROUP BY document_id |
What is the sum of silvers for teams with ranks over 3 and totals under 2? | CREATE TABLE table_name_98 (silver INTEGER,rank VARCHAR,total VARCHAR) | SELECT SUM(silver) FROM table_name_98 WHERE rank > 3 AND total < 2 |
What year has an issue price of $697.95? | CREATE TABLE table_58378 ("Year" real,"Theme" text,"Artist" text,"Mintage" real,"Issue Price" text) | SELECT COUNT("Year") FROM table_58378 WHERE "Issue Price" = '$697.95' |
Which team plays against Footscray as the home team? | CREATE TABLE table_name_2 (home_team VARCHAR,away_team VARCHAR) | SELECT home_team FROM table_name_2 WHERE away_team = "footscray" |
how many hours have passed since patient 17667 has received a base excess test for the first time on this hospital encounter? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE microbiologyevents (row_... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'base excess') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17667 AND admiss... |
what is drug type and drug route of drug name neo*iv*vancomycin? | 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 diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "NEO*IV*Vancomycin" |
Top 5 User from Surat. | CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,Creati... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%surat%' OR UPPER(Location) LIKE '%SURAT' ORDER BY Reputation DESC LIMIT 5 |
Who directed the title 'peggy sue got work'? | CREATE TABLE table_24865 ("No. in series" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text) | SELECT "Directed by" FROM table_24865 WHERE "Title" = 'Peggy Sue Got Work' |
HTTP imgur links (instead of HTTPS). | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text... | SELECT CreationDate, Id AS "post_link" FROM Posts WHERE PostTypeId IN (1, 2) AND (Body LIKE '%http://i.stack.imgur.com%' OR Body LIKE '%http://i.imgur.com%') ORDER BY CreationDate DESC LIMIT 1000 |
List all program origins in the alphabetical order. | CREATE TABLE program (origin VARCHAR) | SELECT origin FROM program ORDER BY origin |
Name the telephone 052 for area km2 being 5.42 | CREATE TABLE table_14465924_1 (telephone__052_ VARCHAR,area__km_2__ VARCHAR) | SELECT telephone__052_ FROM table_14465924_1 WHERE area__km_2__ = "5.42" |
Who was the driver in grid 01 1? | CREATE TABLE table_2231 ("Pos" text,"No" text,"Driver" text,"Constructor" text,"Part 1" text,"Part 2" text,"Part 3" text,"Grid" text) | SELECT "Driver" FROM table_2231 WHERE "Grid" = '01 1' |
what was the name of the competition that took place before the olympic games in 1996 ? | CREATE TABLE table_203_874 (id number,"year" number,"competition" text,"venue" text,"position" text,"event" text,"notes" text) | SELECT "competition" FROM table_203_874 WHERE "year" < (SELECT "year" FROM table_203_874 WHERE "competition" = 'olympic games' AND "year" = 1996) ORDER BY "year" DESC LIMIT 1 |
What type are State Assemblyman | CREATE TABLE table_20478 ("Office" text,"Type" text,"Location" text,"Elected" real,"Term began" text,"Term ended" text) | SELECT "Type" FROM table_20478 WHERE "Office" = 'State Assemblyman' |
How many losses occurred with less than 8 games played and less than 3 wins? | CREATE TABLE table_56333 ("Team" text,"Games Played" real,"Wins" real,"Losses" real,"Ties" real,"Goals For" real,"Goals Against" real) | SELECT COUNT("Losses") FROM table_56333 WHERE "Games Played" < '8' AND "Wins" < '3' |
What year had a cup position of round 1 and a league position of 5/12? | CREATE TABLE table_49101 ("Year" text,"League Position" text,"League" text,"Domestic Cup" text,"Cup Position" text) | SELECT "Year" FROM table_49101 WHERE "Cup Position" = 'round 1' AND "League Position" = '5/12' |
What is Position, when Year is less than 2000, and when Player is 'Radek Dvorak Category:Articles with hCards'? | CREATE TABLE table_name_81 (position VARCHAR,year VARCHAR,player VARCHAR) | SELECT position FROM table_name_81 WHERE year < 2000 AND player = "radek dvorak category:articles with hcards" |
What is the total number of wins that has byes less than 0? | CREATE TABLE table_58751 ("South West DFL" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real) | SELECT COUNT("Wins") FROM table_58751 WHERE "Byes" < '0' |
Who is the away team when the home team scores 10.17 (77)? | CREATE TABLE table_33506 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team" FROM table_33506 WHERE "Home team score" = '10.17 (77)' |
What is the end (UTC) for spacecraft STS-114 Eva 3? | CREATE TABLE table_2611 ("#" text,"Spacecraft" text,"Spacewalkers" text,"Start (UTC)" text,"End (UTC)" text,"Duration" text) | SELECT "End (UTC)" FROM table_2611 WHERE "Spacecraft" = 'STS-114 EVA 3' |
Find the maximum and minimum settlement amount. | CREATE TABLE settlements (settlement_id number,claim_id number,effective_date time,settlement_amount number)CREATE TABLE available_policies (policy_id number,policy_type_code text,customer_phone text)CREATE TABLE customers (customer_id number,customer_name text)CREATE TABLE services (service_id number,service_name text... | SELECT MAX(settlement_amount), MIN(settlement_amount) FROM settlements |
is there any microbiological test result in a month before for patient 61751's bile? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE microbiologyevents (ro... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 61751) AND microbiologyevents.spec_type_desc = 'bile' AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 mon... |
AWS Questions: Time until Answer. | CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE CloseAsOff... | SELECT Question.Id, MIN(Question.CreationDate) AS Question_date, MIN(Answer.CreationDate) AS Answer_date FROM Posts AS Question LEFT OUTER JOIN Posts AS Answer ON Question.Id = Answer.ParentId WHERE Question.PostTypeId = 1 AND Question.ClosedDate IS NULL AND (Question.Tags LIKE '%<amazon-%' OR Question.Tags LIKE '%<aws... |
Who was the coach of the Pandas when their overall record was 20-6-2? | CREATE TABLE table_27069503_2 (coach VARCHAR,overall VARCHAR) | SELECT coach FROM table_27069503_2 WHERE overall = "20-6-2" |
What country is ranked larger than 4? | CREATE TABLE table_name_72 (country VARCHAR,rank INTEGER) | SELECT country FROM table_name_72 WHERE rank > 4 |
Which Venue has a Year of 2005? | CREATE TABLE table_name_37 (venue VARCHAR,year VARCHAR) | SELECT venue FROM table_name_37 WHERE year = "2005" |
What is the singular if the plural is xweer(a)du? | CREATE TABLE table_39940 ("singular" text,"singular gender" text,"plural" text,"plural gender" text,"meaning" text) | SELECT "singular" FROM table_39940 WHERE "plural" = 'xweer(a)du' |
What was the score of the game against the Braves with a record of 41 27? | CREATE TABLE table_75593 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Stadium" text,"Attendance" real,"Record" text) | SELECT "Score" FROM table_75593 WHERE "Opponent" = 'braves' AND "Record" = '41–27' |
How many Against has Byes smaller than 2? | CREATE TABLE table_name_15 (against INTEGER,byes INTEGER) | SELECT AVG(against) FROM table_name_15 WHERE byes < 2 |
What is the lowest reg gp of the player with a round # more than 2, a pick # of 80, and a PI GP larger than 0? | CREATE TABLE table_58436 ("Rd #" real,"Pick #" real,"Player" text,"Team (League)" text,"Reg GP" real,"Pl GP" real) | SELECT MIN("Reg GP") FROM table_58436 WHERE "Rd #" > '2' AND "Pick #" = '80' AND "Pl GP" > '0' |
From what school was a player drafted in 1950? | CREATE TABLE table_32638 ("Player" text,"Nationality" text,"Position" text,"From" text,"School/Country" text) | SELECT "School/Country" FROM table_32638 WHERE "From" = '1950' |
What's Brazil's lane with a time less than 21.15? | CREATE TABLE table_79703 ("Rank" real,"Lane" real,"Athlete" text,"Nationality" text,"Time" real,"React" real) | SELECT MIN("Lane") FROM table_79703 WHERE "Nationality" = 'brazil' AND "Time" < '21.15' |
What is the report for the race that Ayrton Senna won on 27 August? | CREATE TABLE table_name_84 (report VARCHAR,winning_driver VARCHAR,date VARCHAR) | SELECT report FROM table_name_84 WHERE winning_driver = "ayrton senna" AND date = "27 august" |
how many patients whose diagnoses short title is pure hyperglyceridemia and lab test fluid is pleural? | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Pure hyperglyceridemia" AND lab.fluid = "Pleural" |
Count of posts where more than 10 comments. | CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE Tags (Id number,Tag... | SELECT Id FROM (SELECT p.Id, COUNT(*) AS CommentCount FROM Posts AS p INNER JOIN Comments AS c ON c.PostId = p.Id GROUP BY p.Id, p.Title, p.CreationDate, CommentCount HAVING CommentCount > 100) AS t |
How many home wins occured win the road games are larger than 3.0 but road win percentage is .000? | CREATE TABLE table_920 ("Num" real,"Team" text,"W" real,"L" real,"PCT" text,"PF" real,"PA" real,"Last appearance" real,"Last championship" text,"HOME games" real,"Home wins" real,"Home losses" real,"Home Win Pct." text,"ROAD games" real,"Road wins" real,"Road losses" real,"Road Win Pct." text) | SELECT "Home wins" FROM table_920 WHERE "Road Win Pct." = '.000' AND "ROAD games" > '3.0' |
What was Juan Manuel Fangio's reported pole position and the tire of C? | CREATE TABLE table_53250 ("Race" text,"Circuit" text,"Date" text,"Pole position" text,"Winning driver" text,"Constructor" text,"Tyre" text,"Report" text) | SELECT "Report" FROM table_53250 WHERE "Pole position" = 'juan manuel fangio' AND "Tyre" = 'c' |
Give me the comparison about ID over the meter_300 , and I want to display by the ID in asc. | CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time ... | SELECT meter_300, ID FROM swimmer ORDER BY ID |
How many districts have an incumbent first elected in 1940? | CREATE TABLE table_1342256_10 (district VARCHAR,first_elected VARCHAR) | SELECT COUNT(district) FROM table_1342256_10 WHERE first_elected = 1940 |
For each bed type, find the average room price Show bar chart, order X from low to high order. | 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, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY bedType |
Who won Miss Universe Philippines when Regina Hahn was second runner-up? | CREATE TABLE table_62433 ("Year" real,"Miss Universe Philippines" text,"Binibining Pilipinas-World" text,"Binibining Pilipinas-International" text,"Binibining Pilipinas-Tourism" text,"First runner-up" text,"Second runner-up" text) | SELECT "Miss Universe Philippines" FROM table_62433 WHERE "Second runner-up" = 'regina hahn' |
What is the City/State of the Oran Park race? | CREATE TABLE table_name_85 (city___state VARCHAR,race_title VARCHAR) | SELECT city___state FROM table_name_85 WHERE race_title = "oran park" |
what are patient 002-39753's gender? | 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 diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,... | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '002-39753' |
What was the outcome in 1982 with Kang Haeng-Suk as partner? | CREATE TABLE table_39218 ("Outcome" text,"Event" text,"Year" text,"Venue" text,"Partner" text) | SELECT "Outcome" FROM table_39218 WHERE "Partner" = 'kang haeng-suk' AND "Year" = '1982' |
Which circuit has a length of 45 minutes and is held on August 6? | CREATE TABLE table_name_78 (circuit VARCHAR,length VARCHAR,date VARCHAR) | SELECT circuit FROM table_name_78 WHERE length = "45 minutes" AND date = "august 6" |
Which series had a score of l 103 112 (ot)? | CREATE TABLE table_27713030_16 (series VARCHAR,score VARCHAR) | SELECT series FROM table_27713030_16 WHERE score = "L 103–112 (OT)" |
Name the number of class aaaaa for 1988-89 | CREATE TABLE table_14601528_2 (class_aAAAA VARCHAR,school_year VARCHAR) | SELECT COUNT(class_aAAAA) FROM table_14601528_2 WHERE school_year = "1988-89" |
What is the date of the Kmart greater greensboro open in North Carolina? | CREATE TABLE table_5727 ("Date" text,"Tournament" text,"Location" text,"Winner" text,"Score" text,"1st prize ($)" real) | SELECT "Date" FROM table_5727 WHERE "Location" = 'north carolina' AND "Tournament" = 'kmart greater greensboro open' |
What is the Date of the game with a Score of 4 6, 4 6? | CREATE TABLE table_43592 ("Outcome" text,"Date" text,"Championship" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Date" FROM table_43592 WHERE "Score" = '4–6, 4–6' |
When does Classic Hits air? | CREATE TABLE table_name_94 (time VARCHAR,show_name VARCHAR) | SELECT time FROM table_name_94 WHERE show_name = "classic hits" |
how many hours have passed since patient 6170 has been admitted to the icu? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE d_items (row_id number,itemid number,label te... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6170) AND icustays.outtime IS NULL |
what was the achievement for the rival at scottish claymores | CREATE TABLE table_30074 ("Week" real,"Date" text,"Kickoff" text,"Opponent" text,"Final score" text,"Team record" text,"Game site" text,"Attendance" real) | SELECT "Team record" FROM table_30074 WHERE "Opponent" = 'at Scottish Claymores' |
what's the leading scorer where home is sacramento kings | CREATE TABLE table_11964047_9 (leading_scorer VARCHAR,home VARCHAR) | SELECT leading_scorer FROM table_11964047_9 WHERE home = "Sacramento Kings" |
What was the hometown/high school of 170 pound player tyler wilson? | CREATE TABLE table_name_81 (hometown_highschool VARCHAR,weight VARCHAR,name VARCHAR) | SELECT hometown_highschool FROM table_name_81 WHERE weight = 170 AND name = "tyler wilson" |
Average Reputation by Join Date (Month). | CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE PostTags (PostId nu... | SELECT YEAR(CreationDate) AS cYear, MONTH(CreationDate) AS cMonth, AVG(Reputation) AS avgRep FROM Users GROUP BY YEAR(CreationDate), MONTH(CreationDate) ORDER BY 1, 2 |
What was the lowest city population for the district of rajanpur district with a area of 6 km squared and a serial number less than 29? | CREATE TABLE table_64009 ("Serial No." real,"District" text,"Headquartered City" text,"City Population (2009)" real,"City Area(km 2)" real) | SELECT MIN("City Population (2009)") FROM table_64009 WHERE "City Area(km 2 )" = '6' AND "District" = 'rajanpur district' AND "Serial No." < '29' |
What is the sum of poles of the firestone indy lights series before the 2009 season? | CREATE TABLE table_name_73 (poles INTEGER,series VARCHAR,season VARCHAR) | SELECT SUM(poles) FROM table_name_73 WHERE series = "firestone indy lights series" AND season < 2009 |
How many episodes aired on October 17, 2007? | CREATE TABLE table_27191 ("#" real,"Episode" text,"Air Date" text,"Timeslot (EST)" text,"Rating" text,"Share" real,"18-49 (Rating/Share)" text,"Viewers (m)" text,"Weekly Rank (#)" real) | SELECT COUNT("Episode") FROM table_27191 WHERE "Air Date" = 'October 17, 2007' |
My Comments Order By Score(Votes No). | CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId nu... | SELECT * FROM Comments WHERE UserId = 1600305 ORDER BY Score DESC |
Top 50 Mobile Developers from Gujarat. | CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%kochi%' AND (LOWER(AboutMe) LIKE '%android%') ORDER BY Reputation DESC LIMIT 50 |
what is the number of times that intracranial/cerebral perfusion pressure monitoring - subarachnoid bolt is performed this year? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE microlab (microlabid number,patientuni... | SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'intracranial/cerebral perfusion pressure monitoring - subarachnoid bolt' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') |
Who wrote 'Stop Being all Funky'? | CREATE TABLE table_16970 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real) | SELECT "Written by" FROM table_16970 WHERE "Title" = 'Stop Being All Funky' |
For all the claims whose claimed amount is larger than the average, bin the settlement date into the day of week interval and count them for visualizing a bar chart. | CREATE TABLE Payments (Payment_ID INTEGER,Settlement_ID INTEGER,Payment_Method_Code VARCHAR(255),Date_Payment_Made DATE,Amount_Payment INTEGER)CREATE TABLE Customers (Customer_ID INTEGER,Customer_Details VARCHAR(255))CREATE TABLE Customer_Policies (Policy_ID INTEGER,Customer_ID INTEGER,Policy_Type_Code CHAR(15),Start_D... | SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Claims WHERE Amount_Claimed > (SELECT AVG(Amount_Claimed) FROM Claims) |
how much does patient 13473's change of arterial bp mean last measured on the last intensive care unit visit compared to the first value measured on the last intensive care unit visit? | CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location... | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13473) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents... |
What is the median household income when the per capita is $21,585? | CREATE TABLE table_name_56 (median_household_income VARCHAR,per_capita_income VARCHAR) | SELECT median_household_income FROM table_name_56 WHERE per_capita_income = "$21,585" |
Name the lowest Televotes which has monika sokolovska and a Rank larger than 15? | CREATE TABLE table_46653 ("Draw" real,"Song" text,"Performer" text,"Televotes" real,"Rank" real) | SELECT MIN("Televotes") FROM table_46653 WHERE "Performer" = 'monika sokolovska' AND "Rank" > '15' |
What is the decision of the game on January 13? | CREATE TABLE table_name_24 (decision VARCHAR,date VARCHAR) | SELECT decision FROM table_name_24 WHERE date = "january 13" |
What is the report for round 9? | CREATE TABLE table_name_9 (report VARCHAR,round VARCHAR) | SELECT report FROM table_name_9 WHERE round = 9 |
What To par has a Score of 71-73-71-71=286? | CREATE TABLE table_name_85 (to_par VARCHAR,score VARCHAR) | SELECT to_par FROM table_name_85 WHERE score = 71 - 73 - 71 - 71 = 286 |
Which position is round 7? | CREATE TABLE table_34684 ("Round" real,"Player" text,"Position" text,"Nationality" text,"College/Junior/Club Team (League)" text) | SELECT "Position" FROM table_34684 WHERE "Round" = '7' |
provide the number of patients whose admission type is urgent and diagnoses icd9 code is 7756? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)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 tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.icd9_code = "7756" |
list flights from SAN JOSE to HOUSTON next sunday | CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUSTON' AND date_day.day_number = 27 AND date_day.month_number = 8 AND d... |
List all the participant ids and their details using a bar chart, rank in desc by the Participant_ID please. | CREATE TABLE Events (Event_ID INTEGER,Service_ID INTEGER,Event_Details VARCHAR(255))CREATE TABLE Participants_in_Events (Event_ID INTEGER,Participant_ID INTEGER)CREATE TABLE Services (Service_ID INTEGER,Service_Type_Code CHAR(15))CREATE TABLE Participants (Participant_ID INTEGER,Participant_Type_Code CHAR(15),Participa... | SELECT Participant_Details, Participant_ID FROM Participants ORDER BY Participant_ID DESC |
What was the course type on 22 May? | CREATE TABLE table_name_13 (type VARCHAR,date VARCHAR) | SELECT type FROM table_name_13 WHERE date = "22 may" |
Compare post counts for 2 tags. | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostTy... | SELECT COUNT(PostId) AS c, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.CreationDate < '2017-01-01' AND Posts.CreationDate > '2016-01-01' AND TagName IN ('4d', 'java', 'c#', 'php', 'cobol', 'ms-access', '4d-database') GROUP BY TagName |
what are the changes in calculated total co2 of patient 27172 last measured on the current hospital visit compared to the first value measured on the current hospital visit? | CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE microbiologyevents (row... | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27172 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated total co2') ORDER BY labeven... |
Give me the comparison about the average of Team_ID over the ACC_Road , and group by attribute ACC_Road by a bar chart, and list Y from high to low order please. | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce... | SELECT ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(Team_ID) DESC |
cheapest fare from MEMPHIS to SEATTLE | CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE restriction (restriction_code... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MEMPHIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city... |
Out of all the 400 -level courses , which of them do n't have labs ? | CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students int,heavy_assignments int,respected int,participation int,heavy_reading int,tough_grade... | SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N' AND number < 400 + 100 AND number >= 400 |
What is the qual with 200 laps and a rank of 27? | CREATE TABLE table_name_86 (qual VARCHAR,laps VARCHAR,rank VARCHAR) | SELECT qual FROM table_name_86 WHERE laps = 200 AND rank = "27" |
What the least quantity having a T2A class? | CREATE TABLE table_name_50 (quantity_rebuilt INTEGER,class VARCHAR) | SELECT MIN(quantity_rebuilt) FROM table_name_50 WHERE class = "t2a" |
For the game played at the Boston Garden with a score of 118-110, what is the opposing team's record? | CREATE TABLE table_45850 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Record" text) | SELECT "Record" FROM table_45850 WHERE "Location" = 'boston garden' AND "Score" = '118-110' |
What are the countries of all airlines whose names start with Orbit, and count them by a bar chart, sort bars in desc order. | CREATE TABLE airlines (alid integer,name text,iata varchar(2),icao varchar(3),callsign text,country text,active varchar(2))CREATE TABLE routes (rid integer,dst_apid integer,dst_ap varchar(4),src_apid bigint,src_ap varchar(4),alid bigint,airline varchar(4),codeshare text)CREATE TABLE airports (apid integer,name text,cit... | SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country ORDER BY country DESC |
Get all answers containing 'help me'. | CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAu... | SELECT Id AS "post_link", Body, Score FROM Posts WHERE PostTypeId = 2 AND (Body LIKE '%please help me%') |
count the number of patients whose age is less than 61 and days of hospital stay is greater than 23? | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "61" AND demographic.days_stay > "23" |
Posts whose only tag is <general-physics+>. | CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TAB... | SELECT Id AS "post_link", Tags, CreationDate, ClosedDate FROM Posts WHERE Tags LIKE '<general-physics+>' |
What is the Margin that has a Venue of bellerive oval , hobart, and a Season of 2002/03? | CREATE TABLE table_8063 ("Rank" text,"Margin" text,"Opponent" text,"Venue" text,"Season" text) | SELECT "Margin" FROM table_8063 WHERE "Venue" = 'bellerive oval , hobart' AND "Season" = '2002/03' |
What episode title had a production code of 3x6306? | CREATE TABLE table_28116528_1 (title VARCHAR,production_code VARCHAR) | SELECT title FROM table_28116528_1 WHERE production_code = "3X6306" |
How many earnings have Wins larger than 3? | CREATE TABLE table_name_70 (earnings___ INTEGER,wins INTEGER) | SELECT SUM(earnings___) AS $__ FROM table_name_70 WHERE wins > 3 |
What was the away team's score when home team Carlton scored 15.16 (106)? | CREATE TABLE table_33475 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team score" FROM table_33475 WHERE "Home team score" = '15.16 (106)' AND "Home team" = 'carlton' |
Which Week has an Opponent of at seattle seahawks? | CREATE TABLE table_name_11 (week VARCHAR,opponent VARCHAR) | SELECT week FROM table_name_11 WHERE opponent = "at seattle seahawks" |
who is the featuring when the doctor is the 6th and the series sorted is 6y/ak? | CREATE TABLE table_47444 ("Series Sorted" text,"Title" text,"Doctor" text,"Featuring" text,"Released" text) | SELECT "Featuring" FROM table_47444 WHERE "Doctor" = '6th' AND "Series Sorted" = '6y/ak' |
show me the flights to DAL | CREATE TABLE code_description (code varchar,description text)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days te... | SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, flight WHERE airport.airport_code = 'DAL' AND city.city_code = airport_service.city_code AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code |
count the number of patients who this year had an intake of d5 normal saline. | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE admissions (row_id ... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'd5 normal saline' A... |
calculate the number of patients who received a lab test of magnesium, urine in this year. | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicit... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'magnesium, urine') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(),... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.