instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What is Set 4, when Set 5 is NA, and when Set 3 is 19-25? | CREATE TABLE table_41783 ("Date" text,"Score" text,"Set 1" text,"Set 2" text,"Set 3" text,"Set 4" text,"Set 5" text,"Total" text) | SELECT "Set 4" FROM table_41783 WHERE "Set 5" = 'na' AND "Set 3" = '19-25' |
give me the number of patients whose diagnoses icd9 code is 55221 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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "55221" AND lab.fluid = "Pleural" |
Which episode had Jamie and John's guest as Mike Tindall? | CREATE TABLE table_30957 ("Episode" text,"First broadcast" text,"Andrew and Georgies guest" text,"Jamie and Johns guest Dermot OLeary replaced Jamie Redknapp as team captain for one week in series 3,episode 8." text,"Scores" text) | SELECT "Episode" FROM table_30957 WHERE "Jamie and Johns guest Dermot OLeary replaced Jamie Redknapp as team captain for one week in series 3, episode 8." = 'Mike Tindall' |
what airline is YX | CREATE TABLE code_description (code varchar,description text)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABL... | SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'YX' |
list flights from LAS VEGAS to PHOENIX | 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 text)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer va... | 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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'LAS VEGAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHOE... |
Name the number of bowl for lee corso, gene chizik and chip kelly | CREATE TABLE table_29374 ("Year" real,"Network(s)" text,"Bowl" text,"Play-by-play announcer" text,"Color analyst(s)" text,"Sideline reporter(s)" text,"Studio host(s)" text,"Studio analyst(s)" text,"TV Rating" text) | SELECT COUNT("Bowl") FROM table_29374 WHERE "Studio analyst(s)" = 'Lee Corso, Gene Chizik and Chip Kelly' |
Which Games is the highest one that has a Drawn smaller than 0? | CREATE TABLE table_name_26 (games INTEGER,drawn INTEGER) | SELECT MAX(games) FROM table_name_26 WHERE drawn < 0 |
When John Harkes was the color commentator, and Alexi Lalas and Steve McManaman were the pregame analysts, who were the sideline reporters? | CREATE TABLE table_name_84 (sideline_reporters VARCHAR,color_commentator VARCHAR,pregame_analysts VARCHAR) | SELECT sideline_reporters FROM table_name_84 WHERE color_commentator = "john harkes" AND pregame_analysts = "alexi lalas and steve mcmanaman" |
List the number of departments for each building with a bar chart, show by the how many building from high to low. | CREATE TABLE course (course_id varchar(8),title varchar(50),dept_name varchar(20),credits numeric(2,0))CREATE TABLE instructor (ID varchar(5),name varchar(20),dept_name varchar(20),salary numeric(8,2))CREATE TABLE time_slot (time_slot_id varchar(4),day varchar(1),start_hr numeric(2),start_min numeric(2),end_hr numeric(... | SELECT building, COUNT(building) FROM department GROUP BY building ORDER BY COUNT(building) DESC |
Name the money spent for 2Q having candidate of john mccain | CREATE TABLE table_name_84 (money_spent VARCHAR,_2q VARCHAR,candidate VARCHAR) | SELECT money_spent, _2q FROM table_name_84 WHERE candidate = "john mccain" |
What is the lowest goals for value with fewer than 5 draws and under 70 points? | CREATE TABLE table_38163 ("Season" real,"Belonging league" text,"Matches" real,"Points" real,"Draw" real,"Lose" real,"Goal difference" real,"Goals For" real,"Goals Against" real,"Position" real) | SELECT MIN("Goals For") FROM table_38163 WHERE "Draw" < '5' AND "Points" < '70' |
What was the lowest crowd size at the Windy Hill venue? | CREATE TABLE table_74600 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT MIN("Crowd") FROM table_74600 WHERE "Venue" = 'windy hill' |
For those records from the products and each product's manufacturer, what is the relationship between manufacturer and code ? | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT T1.Manufacturer, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code |
What is the Frequency MHz of Trinidad, Colorado? | CREATE TABLE table_name_6 (frequency_mhz VARCHAR,city_of_license VARCHAR) | SELECT frequency_mhz FROM table_name_6 WHERE city_of_license = "trinidad, colorado" |
What was the Comp average, having Gino Guidugli as a player and a rating of more than 92.2? | CREATE TABLE table_52868 ("Player" text,"Att." real,"Comp" real,"Yards" real,"Rating" real) | SELECT AVG("Comp") FROM table_52868 WHERE "Player" = 'gino guidugli' AND "Rating" > '92.2' |
Visualize a bar chart for what is the number of their teams in elimination? | CREATE TABLE Elimination (Elimination_ID text,Wrestler_ID text,Team text,Eliminated_By text,Elimination_Move text,Time text)CREATE TABLE wrestler (Wrestler_ID int,Name text,Reign text,Days_held text,Location text,Event text) | SELECT Team, COUNT(Team) FROM Elimination GROUP BY Team |
how many patients whose primary disease is hypoxia and procedure short title is suture bladder lacerat? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "HYPOXIA" AND procedures.short_title = "Suture bladder lacerat" |
How many colleges has more than 15000 students? | CREATE TABLE college (cname text,state text,enr number)CREATE TABLE tryout (pid number,cname text,ppos text,decision text)CREATE TABLE player (pid number,pname text,ycard text,hs number) | SELECT COUNT(*) FROM college WHERE enr > 15000 |
Which Leading Scorer has an Opponent of @ indiana? | CREATE TABLE table_50838 ("Date" text,"Opponent" text,"Score" text,"Leading Scorer" text,"Attendance" real,"Record" text) | SELECT "Leading Scorer" FROM table_50838 WHERE "Opponent" = '@ indiana' |
What is the Original title of Children of Sarajevo? | CREATE TABLE table_42397 ("Year (Ceremony)" text,"Film title used in nomination" text,"Original title" text,"Director" text,"Result" text) | SELECT "Original title" FROM table_42397 WHERE "Film title used in nomination" = 'children of sarajevo' |
What were the outcomes of matches with bill tilden florence ballin as opponents? | CREATE TABLE table_2127933_3 (outcome VARCHAR,opponents VARCHAR) | SELECT outcome FROM table_2127933_3 WHERE opponents = "Bill Tilden Florence Ballin" |
Which deputy took office in 1976? | CREATE TABLE table_name_97 (name VARCHAR,took_office VARCHAR) | SELECT name FROM table_name_97 WHERE took_office = "1976" |
What was the attendance for the game when the challenge leader was at Big East (4-2)? | CREATE TABLE table_23749 ("Date" text,"Time" text,"Big East Team" text,"SEC Team" text,"Location" text,"Television" text,"Attendance" real,"Winner" text,"Challenge Leader" text) | SELECT MAX("Attendance") FROM table_23749 WHERE "Challenge Leader" = 'Big East (4-2)' |
calculate the number of times patient 030-6898 received the bedside glucose test test since 3 years ago. | 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 COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-6898')) AND lab.labname = 'bedside glucose' AND DATETIME(lab.labresulttime) >= DATETIME(... |
Scatter. how many students does one classroom have? | CREATE TABLE list (LastName TEXT,FirstName TEXT,Grade INTEGER,Classroom INTEGER)CREATE TABLE teachers (LastName TEXT,FirstName TEXT,Classroom INTEGER) | SELECT COUNT(*), Classroom FROM list GROUP BY Classroom |
Show the order ids and the number of items in each order. | CREATE TABLE orders (order_id number,customer_id number,date_order_placed time,order_details text)CREATE TABLE invoices (invoice_number number,order_id number,invoice_date time)CREATE TABLE accounts (account_id number,customer_id number,date_account_opened time,account_name text,other_account_details text)CREATE TABLE ... | SELECT order_id, COUNT(*) FROM order_items GROUP BY order_id |
provide the number of patients whose year of birth is less than 2098 and drug route is dialys? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)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 ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2098" AND prescriptions.route = "DIALYS" |
View count statistics by age group (grouped by month). | CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDi... | SELECT DISTINCT (DATEDIFF(MONTH, CreationDate, GETDATE())) AS "Age in months", PERCENTILE_CONT(0.25) WITHIN GROUP (ORDER BY ViewCount) OVER (PARTITION BY DATEDIFF(MONTH, CreationDate, GETDATE())) AS "25%", PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY ViewCount) OVER (PARTITION BY DATEDIFF(MONTH, CreationDate, GETDATE())... |
What is the to par of the player with a 72-71-65-69=277 score? | CREATE TABLE table_name_55 (to_par VARCHAR,score VARCHAR) | SELECT to_par FROM table_name_55 WHERE score = 72 - 71 - 65 - 69 = 277 |
Which team has the location attendance of American Airlines Center 19954? | CREATE TABLE table_2848 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Team" FROM table_2848 WHERE "Location Attendance" = 'American Airlines Center 19954' |
what is the year union university was founded? | CREATE TABLE table_1715730_2 (founded VARCHAR,institution VARCHAR) | SELECT founded FROM table_1715730_2 WHERE institution = "Union University" |
Which customer had at least 2 policies but did not file any claims? List the customer details and id. | CREATE TABLE Customers (customer_details VARCHAR,customer_id VARCHAR,Customer_id VARCHAR)CREATE TABLE Customer_Policies (customer_id VARCHAR,policy_id VARCHAR)CREATE TABLE Claims (policy_id VARCHAR) | SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2 EXCEPT SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id = T2.customer_id JOIN Claims ... |
How many people attended the game where the leading scorer was Tim Duncan (24), and the home team was the Spurs? | CREATE TABLE table_54810 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Attendance" real,"Record" text) | SELECT MIN("Attendance") FROM table_54810 WHERE "Leading scorer" = 'tim duncan (24)' AND "Home" = 'spurs' |
Which townland has a 213 acre area? | CREATE TABLE table_31506 ("Townland" text,"Area(acres)" real,"Barony" text,"Civil parish" text,"Poor law union" text) | SELECT "Townland" FROM table_31506 WHERE "Area( acres )" = '213' |
What is the lowest Top-25 when events shows 12, the top-5 is 1, and less than 11 cuts? | CREATE TABLE table_name_63 (top_25 INTEGER,cuts_made VARCHAR,events VARCHAR,top_5 VARCHAR) | SELECT MIN(top_25) FROM table_name_63 WHERE events = 12 AND top_5 = 1 AND cuts_made < 11 |
Who was the leading scorer in Game #26? | CREATE TABLE table_17335 ("#" real,"Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Attendance" text,"Record" text,"Streak" text) | SELECT "Leading scorer" FROM table_17335 WHERE "#" = '26' |
What is the Equatorial diameter of the Body: Mars? | CREATE TABLE table_36793 ("Body" text,"Equatorial diameter" text,"Polar diameter" text,"Equatorial bulge" text,"Flattening ratio" text) | SELECT "Equatorial diameter" FROM table_36793 WHERE "Body" = 'mars' |
who are the participants from hanover? | CREATE TABLE table_26427332_17 (contestant VARCHAR,city VARCHAR) | SELECT contestant FROM table_26427332_17 WHERE city = "Hanover" |
What is the average weight of Jeremy Case, who plays guard? | CREATE TABLE table_5729 ("Name" text,"Position" text,"Height" text,"Weight" real,"Year" text,"Home Town" text) | SELECT AVG("Weight") FROM table_5729 WHERE "Position" = 'guard' AND "Name" = 'jeremy case' |
in their first hospital encounter had patient 9038 received a sm bowel endoscopy nec procedure? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)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 inputevents_cv (row_... | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'sm bowel endoscopy nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9038 AND NOT admissions.... |
What current conference is Post University a member of? | CREATE TABLE table_584 ("Institution" text,"Location" text,"Nickname" text,"Current Conference" text,"Classification" text) | SELECT "Current Conference" FROM table_584 WHERE "Institution" = 'Post University' |
Which runner-up has a 10 strokes margin of victory? | CREATE TABLE table_name_12 (runner_up VARCHAR,margin_of_victory VARCHAR) | SELECT runner_up FROM table_name_12 WHERE margin_of_victory = "10 strokes" |
What is the episode number of the episode that aired on August 8, 2005? | CREATE TABLE table_33701 ("Episode Number" real,"Title" text,"Podcast Date" text,"Run time" text,"Historical References" text) | SELECT "Episode Number" FROM table_33701 WHERE "Podcast Date" = 'august 8, 2005' |
how many patients whose admission location is emergency room admit and item id is 51131? | CREATE TABLE diagnoses (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 text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND lab.itemid = "51131" |
Which team drafted the player from the HC Lada Togliatti (Russia)? | CREATE TABLE table_30508 ("Pick" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT "NHL team" FROM table_30508 WHERE "College/junior/club team" = 'HC Lada Togliatti (Russia)' |
Is STDABRD 485 scheduled for morning classes ? | CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'STDABRD' AND course.number = 485 AND semester.semester = 'WN' AND semester.semester_id = course_... |
What is the IHSAA class for Tipton? | CREATE TABLE table_name_3 (ihsaa_class VARCHAR,school VARCHAR) | SELECT ihsaa_class FROM table_name_3 WHERE school = "tipton" |
What is the career win-loss for the ATP Masters Series? | CREATE TABLE table_name_3 (career_win_loss VARCHAR) | SELECT career_win_loss FROM table_name_3 WHERE 1995 = "atp masters series" |
Name the genre for release-year of first charted record of 1988 | CREATE TABLE table_name_98 (genre VARCHAR,release_year_of_first_charted_record VARCHAR) | SELECT genre FROM table_name_98 WHERE release_year_of_first_charted_record = 1988 |
how many cahokia phases were there ? | CREATE TABLE table_203_645 (id number,"lower mississippi periods" text,"lower yazoo phases" text,"lower yazoo\ndates" text,"tensas/natchez phases" text,"cahokia phases" text,"cahokia dates" text,"ohio/miss. river\nconfluence phases" text,"ohio/miss. dates" text) | SELECT COUNT(DISTINCT "cahokia phases") FROM table_203_645 |
What date did Week 9 begin? | CREATE TABLE table_43428 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT "Date" FROM table_43428 WHERE "Week" = '9' |
How many full professors work under Hartmut Kliemt with more than 0 lecturers? | CREATE TABLE table_15811 ("Department" text,"Head" text,"Full professors" real,"Honorary professors" real,"Lecturers" real) | SELECT COUNT("Full professors") FROM table_15811 WHERE "Head" = 'hartmut kliemt' AND "Lecturers" > '0' |
What are the ids and names of the architects who built at least 3 bridges . Show the proportion. | CREATE TABLE mill (architect_id int,id int,location text,name text,type text,built_year int,notes text)CREATE TABLE architect (id text,name text,nationality text,gender text)CREATE TABLE bridge (architect_id int,id int,name text,location text,length_meters real,length_feet real) | SELECT T1.name, T1.id FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id |
What is the average for the gymnast with a 9.9 start value and a total of 9.612? | CREATE TABLE table_name_33 (average INTEGER,start_value VARCHAR,total VARCHAR) | SELECT AVG(average) FROM table_name_33 WHERE start_value = 9.9 AND total = 9.612 |
What is the sum of Total when rank is 2? | CREATE TABLE table_76080 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT SUM("Total") FROM table_76080 WHERE "Rank" = '2' |
If the Non- stop is ( ), what is the Articulatory Class? | CREATE TABLE table_name_27 (articulatory_class VARCHAR,non__stop VARCHAR) | SELECT articulatory_class FROM table_name_27 WHERE non__stop = "(ㆁ)" |
what was the name of the output which patient 035-17122 had for the first time? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-17122')) AND intakeoutput.cellpath LIKE '%output%' ORDER... |
what is the date on week 6 | CREATE TABLE table_34615 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Record" text,"Game Site" text,"TV Time" text,"Attendance" text) | SELECT "Date" FROM table_34615 WHERE "Week" = '6' |
What college did Louis LeBlanc attend? | CREATE TABLE table_name_66 (college_junior_club_team__league_ VARCHAR,player VARCHAR) | SELECT college_junior_club_team__league_ FROM table_name_66 WHERE player = "louis leblanc" |
Jack Lynch played for the oshawa generals (omjhl) before playing for what nhl team? | CREATE TABLE table_1473672_2 (nhl_team VARCHAR,college_junior_club_team VARCHAR) | SELECT nhl_team FROM table_1473672_2 WHERE college_junior_club_team = "Oshawa Generals (OMJHL)" |
In which stadium does Club Pro Patria play? | CREATE TABLE table_name_43 (stadium VARCHAR,club VARCHAR) | SELECT stadium FROM table_name_43 WHERE club = "pro patria" |
Who was the away team at Western Oval? | CREATE TABLE table_name_52 (away_team VARCHAR,venue VARCHAR) | SELECT away_team FROM table_name_52 WHERE venue = "western oval" |
what are the four most frequent procedures performed since 3 years ago? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,ob... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4 |
is the heartrate of patient 011-23193 last measured on the first icu visit less than the value second to last measured on the first icu visit? | 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 treatment (treatmentid number,patientunitstayi... | SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-23193') AND NOT patient.unitdischargetime IS ... |
How many weeks in total were games played at Cleveland Browns Stadium? | CREATE TABLE table_67702 ("Week" real,"Date" text,"Visiting Team" text,"Host Team" text,"Stadium" text) | SELECT COUNT("Week") FROM table_67702 WHERE "Stadium" = 'cleveland browns stadium' |
How man innings were there during the period with a career average of 41.43? | CREATE TABLE table_21100348_10 (innings VARCHAR,average VARCHAR) | SELECT innings FROM table_21100348_10 WHERE average = "41.43" |
Who did the Orangemen play against when their record was 5-1? | CREATE TABLE table_25995 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Orangemen points" real,"Opponents" real,"Record" text) | SELECT "Opponent" FROM table_25995 WHERE "Record" = '5-1' |
Bar chart x axis date in location from y axis the number of date in location from | CREATE TABLE All_Documents (Document_ID INTEGER,Date_Stored DATETIME,Document_Type_Code CHAR(15),Document_Name CHAR(255),Document_Description CHAR(255),Other_Details VARCHAR(255))CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR(15),Document_Type_Name VARCHAR(255),Document_Type_Description VARCHAR(255))CREATE TA... | SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations |
What is the smallest population in a region greater than 9? | CREATE TABLE table_53818 ("Code" real,"Type" text,"Name" text,"Area (km 2)" real,"Population" real,"Regional County Municipality" text,"Region" real) | SELECT MIN("Population") FROM table_53818 WHERE "Region" > '9' |
What is the name of the young rider classification when Paolo Tiralongo won? | CREATE TABLE table_30588 ("Stage" real,"Winner" text,"General classification" text,"Points classification" text,"Mountains classification" text,"Young rider classification" text) | SELECT "Young rider classification" FROM table_30588 WHERE "Winner" = 'Paolo Tiralongo' |
show me all flights from SAN DIEGO to NEW YORK using DC10 | CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,cap... | SELECT DISTINCT flight.flight_id FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (aircraft.basic_type = 'DC10' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEW YORK' AND equipment_se... |
what are the five most frequent drugs that were prescribed in the same hospital visit to cardiomyopathy male patient, age 40s after they have been diagnosed with cardiomyopathy? | 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.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cardiomyopathy'... |
Meta posts with more than one required tag. | 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 c.PostId AS "post_link", REPLACE(REPLACE(REPLACE(p.Tags, ' ', ' '), '><', ' '), '!= ', '') AS "tags" FROM (SELECT PostId, COUNT(*) AS "count" FROM PostTags WHERE TagId = @TagId1 OR TagId = @TagId2 OR TagId = @TagId3 OR TagId = @TagId4 GROUP BY PostId) AS c LEFT JOIN Posts AS p ON p.Id = c.PostId WHERE c.Count >=... |
What is Socket, when Voltage is 2.0V, and when Model Number is Pentium II 333? | CREATE TABLE table_49714 ("Model number" text,"Frequency" text,"L2 cache" text,"Mult." text,"Voltage" text,"Socket" text) | SELECT "Socket" FROM table_49714 WHERE "Voltage" = '2.0v' AND "Model number" = 'pentium ii 333' |
Which week had 39,056 people in attendance? | CREATE TABLE table_55181 ("Week" text,"Date" text,"Opponent" text,"Result" text,"Kickoff [a ]" text,"Game site" text,"Attendance" text,"Record" text) | SELECT "Week" FROM table_55181 WHERE "Attendance" = '39,056' |
what is the lab test given to patient 009-12221 for the last time in 10/last year? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunits... | SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-12221')) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), ... |
How many overalls have charley barnes as the name, with a pick less than 3? | CREATE TABLE table_name_90 (overall INTEGER,name VARCHAR,pick VARCHAR) | SELECT SUM(overall) FROM table_name_90 WHERE name = "charley barnes" AND pick < 3 |
show me the earliest flight on 8 2 from BOSTON to DENVER that serves a meal | 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 text)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE airpor... | 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, food_service WHERE (((date_day.day_number = 2 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.... |
What is the frequency for the Christian Kawz-fm Translator station? | CREATE TABLE table_134987_3 (frequency VARCHAR,format VARCHAR) | SELECT frequency FROM table_134987_3 WHERE format = "Christian KAWZ-FM translator" |
What genre has a station of Class 95FM? | CREATE TABLE table_name_53 (genre VARCHAR,station VARCHAR) | SELECT genre FROM table_name_53 WHERE station = "class 95fm" |
give me the number of patients whose age is less than 68 and lab test fluid is urine? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)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 ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "68" AND lab.fluid = "Urine" |
For the attribute cName and enr, show their proportion by a pie chart. | CREATE TABLE College (cName varchar(20),state varchar(2),enr numeric(5,0))CREATE TABLE Player (pID numeric(5,0),pName varchar(20),yCard varchar(3),HS numeric(5,0))CREATE TABLE Tryout (pID numeric(5,0),cName varchar(20),pPos varchar(8),decision varchar(3)) | SELECT cName, enr FROM College ORDER BY enr |
Name the accession number for rhodopseudomonas palustris | CREATE TABLE table_29340 ("Genus/Species" text,"Gene Name" text,"Accession number" text,"Sequence Length" text,"Sequence similarity" real) | SELECT "Accession number" FROM table_29340 WHERE "Genus/Species" = 'Rhodopseudomonas palustris' |
What is the notes entry for the row with a Time of 1:42.309? | CREATE TABLE table_name_33 (notes VARCHAR,time VARCHAR) | SELECT notes FROM table_name_33 WHERE time = "1:42.309" |
what is the club in the sixth round proper | CREATE TABLE table_30052 ("Round" text,"Main date" text,"Number of fixtures" real,"Clubs" text,"New entries this round" text,"Prize money" text,"Player of the Round" text) | SELECT "Clubs" FROM table_30052 WHERE "Round" = 'Sixth round proper' |
How many bronze medals are there when there are fewer than 3 silver medals and 7 medals total? | CREATE TABLE table_name_69 (bronze VARCHAR,silver VARCHAR,total VARCHAR) | SELECT bronze FROM table_name_69 WHERE silver < 3 AND total = 7 |
Which Power has Location in metro manila | CREATE TABLE table_name_75 (power__kw_ VARCHAR,location VARCHAR) | SELECT power__kw_ FROM table_name_75 WHERE location = "metro manila" |
which year did they release their first album ? | CREATE TABLE table_204_574 (id number,"year" number,"title" text,"peak chart positions\nswe" number,"peak chart positions\nswi" number,"peak chart positions\nuk" number,"album" text) | SELECT "year" FROM table_204_574 WHERE id = 1 |
Tell me the total number of grid for rider of james toseland | CREATE TABLE table_name_14 (grid VARCHAR,rider VARCHAR) | SELECT COUNT(grid) FROM table_name_14 WHERE rider = "james toseland" |
what are the new prescription drug of patient 808 today compared to that yesterday? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE cha... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 808) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE p... |
When abba is the artist what is the album? | CREATE TABLE table_22350 ("No." real,"Album" text,"Artist" text,"Record label" text,"Released" text,"Chart peak" real,"Number of times certified platinum" text) | SELECT "Album" FROM table_22350 WHERE "Artist" = 'ABBA' |
Average score for answers in Java. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,Creat... | SELECT AVG(Score) AS ave FROM Posts WHERE PostTypeId = 2 AND Tags LIKE '%php%' |
What date was the xiv international gold cup? | CREATE TABLE table_name_80 (date VARCHAR,race_name VARCHAR) | SELECT date FROM table_name_80 WHERE race_name = "xiv international gold cup" |
what's the shigella with yersinia being yscp | CREATE TABLE table_10321124_1 (shigella VARCHAR,yersinia VARCHAR) | SELECT shigella FROM table_10321124_1 WHERE yersinia = "YscP" |
What bike has an accident time, less than 9 laps, and a 5 grid? | CREATE TABLE table_9818 ("Rider" text,"Bike" text,"Laps" real,"Time" text,"Grid" real) | SELECT "Bike" FROM table_9818 WHERE "Time" = 'accident' AND "Laps" < '9' AND "Grid" = '5' |
Top Distinct Tag Badge Counts. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,R... | SELECT UserId AS "user_link", COUNT(DISTINCT LOWER(Name)) AS NumTagBadges, COUNT(*) AS CountTagBadges FROM Badges WHERE Name IN (SELECT TagName FROM Tags) GROUP BY UserId ORDER BY NumTagBadges DESC LIMIT 10 |
What was the BBI for the bowler whose average is 24.50? | CREATE TABLE table_30111 ("Player" text,"Matches" real,"Overs" text,"Wickets" real,"Average" text,"Economy" text,"BBI" text,"4wi" real) | SELECT "BBI" FROM table_30111 WHERE "Average" = '24.50' |
When was the finale played when the show premiered on September 24, 2002? | CREATE TABLE table_9652 ("Season" text,"Premiere" text,"Finale" text,"Episodes" real,"Timeslot" text,"Rank" text,"Viewers (in households)" real) | SELECT "Finale" FROM table_9652 WHERE "Premiere" = 'september 24, 2002' |
how many countries did not earn silver medals ? | CREATE TABLE table_204_297 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT COUNT("nation") FROM table_204_297 WHERE "silver" = 0 |
What is the average when interview is 9.465 and evening gown is less than 9.454? | CREATE TABLE table_name_28 (average INTEGER,interview VARCHAR,evening_gown VARCHAR) | SELECT SUM(average) FROM table_name_28 WHERE interview = 9.465 AND evening_gown < 9.454 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.