instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
tell me the difference between the total output of patient 1489 and the total input since 07/28/2102. | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod 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)CREA... | SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1489)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) >= '2102-07-28') - (SELE... |
what is the total apps when the league apps is 4 (2)? | CREATE TABLE table_65283 ("Name" text,"Position" text,"League Apps" text,"League Goals" real,"FA Cup Apps" text,"FA Cup Goals" real,"League Cup Apps" text,"League Cup Goals" real,"FLT Apps" text,"FLT Goals" real,"Total Apps" text,"Total Goals" real) | SELECT "Total Apps" FROM table_65283 WHERE "League Apps" = '4 (2)' |
WHAT IS THE NAME OF THE MIXED DOUBLES PLAYER WHEN THE WOMENS SINGLE PLAYER IS KAIRI VIILUP? | CREATE TABLE table_14903627_1 (mixed_doubles VARCHAR,womens_singles VARCHAR) | SELECT mixed_doubles FROM table_14903627_1 WHERE womens_singles = "Kairi Viilup" |
For the gte northwest classic with the score of 207 (-9), what is the average 1st prize ($) | CREATE TABLE table_name_71 (score VARCHAR,tournament VARCHAR) | SELECT AVG(1 AS st_prize__) AS $__ FROM table_name_71 WHERE score = "207 (-9)" AND tournament = "gte northwest classic" |
Name the csa 4/16/09 for opinionway being 4/17/09 of 12% | CREATE TABLE table_name_17 (csa_4_16_09 VARCHAR,opinionway_4_17_09 VARCHAR) | SELECT csa_4_16_09 FROM table_name_17 WHERE opinionway_4_17_09 = "12%" |
Who was the winning team on the circuit Zolder? | CREATE TABLE table_18095719_2 (winning_team VARCHAR,circuit VARCHAR) | SELECT winning_team FROM table_18095719_2 WHERE circuit = "Zolder" |
What is the Singapore Gross with a Title that is 2000? | CREATE TABLE table_name_74 (singapore_gross VARCHAR,title VARCHAR) | SELECT singapore_gross FROM table_name_74 WHERE title = "2000" |
If the Steals are 20, what are the blocks? | CREATE TABLE table_25342713_5 (blocks INTEGER,steals VARCHAR) | SELECT MAX(blocks) FROM table_25342713_5 WHERE steals = 20 |
how many days has it been since the first time ipratropium-albuterol 0.5 mg-3 mg(2.5 mg base)/3 ml inhl neb soln was prescribed during their current hospital encounter to patient 022-6959? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE patient (uniquepid text,patienthealthsystemstayi... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-695... |
What are the names of wines whose production year are before the year of all wines by Brander winery? | CREATE TABLE WINE (Name VARCHAR,YEAR INTEGER,Winery VARCHAR) | SELECT Name FROM WINE WHERE YEAR < (SELECT MIN(YEAR) FROM WINE WHERE Winery = "Brander") |
i want to fly from BOSTON to ATLANTA i would like the cheapest fare please | CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,o... | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... |
What is the nation that had more than 1 gold medal and a total of 62 medals? | CREATE TABLE table_name_31 (nation VARCHAR,gold VARCHAR,total VARCHAR) | SELECT nation FROM table_name_31 WHERE gold > 1 AND total = 62 |
Who were the opposition in the quarter-final? | CREATE TABLE table_75867 ("Round" text,"Opposition" text,"First leg" text,"Second leg" text,"Aggregate score" text) | SELECT "Opposition" FROM table_75867 WHERE "Round" = 'quarter-final' |
what is the minimum highest position with artbeingt being paul evans | CREATE TABLE table_13805432_2 (highest_position INTEGER,artist VARCHAR) | SELECT MIN(highest_position) FROM table_13805432_2 WHERE artist = "Paul Evans" |
What type of move was Elding from ENG? | CREATE TABLE table_name_28 (type VARCHAR,country VARCHAR,name VARCHAR) | SELECT type FROM table_name_28 WHERE country = "eng" AND name = "elding" |
When Tom Watson placed t6, what was the 2 par? | CREATE TABLE table_name_35 (to_par VARCHAR,place VARCHAR,player VARCHAR) | SELECT to_par FROM table_name_35 WHERE place = "t6" AND player = "tom watson" |
Show the number of cities in counties that have a population more than 20000. | CREATE TABLE county_public_safety (county_id number,name text,population number,police_officers number,residents_per_officer number,case_burden number,crime_rate number,police_force text,location text)CREATE TABLE city (city_id number,county_id number,name text,white number,black number,amerindian number,asian number,m... | SELECT COUNT(*) FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE population > 20000) |
What is the word form for the ALA-LC transliteration of muay s ain? | CREATE TABLE table_name_55 (word_form VARCHAR,ala_lc VARCHAR) | SELECT word_form FROM table_name_55 WHERE ala_lc = "muay s″ain" |
which model had the highest starting price | CREATE TABLE table_203_42 (id number,"model" text,"class" text,"length" text,"fuel" text,"starting price" text) | SELECT "model" FROM table_203_42 ORDER BY "starting price" DESC LIMIT 1 |
Before the year 1963 what was the fewest points the climax v8 engine had? | CREATE TABLE table_69425 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real) | SELECT MIN("Points") FROM table_69425 WHERE "Engine" = 'climax v8' AND "Year" < '1963' |
Questions for tag and term. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,Targe... | SELECT Id, Tags FROM Posts AS p1 WHERE p1.Tags LIKE '%' + @tag + '%' AND p1.PostTypeId = 1 EXCEPT (SELECT ParentId, Tags FROM Posts AS p2 WHERE p2.PostTypeId = 2 AND p2.OwnerUserId = 6309 AND p2.Tags LIKE '%' + @tag + '%') |
What place is Jay Hebert? | CREATE TABLE table_45709 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text) | SELECT "Place" FROM table_45709 WHERE "Player" = 'jay hebert' |
list the flights from PHILADELPHIA to SAN FRANCISCO which have a layover in DALLAS | CREATE TABLE code_description (code varchar,description text)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stops int,time... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT... |
hemoglobin a1c between 7 % and 9 % ( inclusive ) | CREATE TABLE table_train_278 ("id" int,"gender" string,"supine" bool,"systolic_blood_pressure_sbp" int,"hemoglobin_a1c_hba1c" float,"estimated_glomerular_filtration_rate_egfr" int,"diastolic_blood_pressure_dbp" int,"serum_creatinine" float,"bilirubin" float,"NOUSE" float) | SELECT * FROM table_train_278 WHERE hemoglobin_a1c_hba1c >= 7 AND hemoglobin_a1c_hba1c <= 9 |
Question Count answered in month of July, 2017. | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuida... | SELECT COUNT(Id) AS QuestionAnswered FROM Posts WHERE PostTypeId = 2 AND CreationDate BETWEEN '2017-07-01' AND '2017-07-31' |
High rep users with Farquaad Syndrome. | CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Tags text,Ans... | SELECT u.Id, u.DisplayName, LENGTH(p.Body) AS Size, p.Id AS "post_link" FROM Users AS u INNER JOIN Posts AS p ON u.Id = p.OwnerUserId WHERE p.PostTypeId = 2 AND LENGTH(p.Body) < 140 AND u.Id = '##UserID:int##' ORDER BY LENGTH(p.Body) |
how many patients have the drug code gent60pm? | 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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "GENT60PM" |
Who directed the show that was viewed by 2.06 million U.S. people? | CREATE TABLE table_11694832_1 (directed_by VARCHAR,us_viewers__millions_ VARCHAR) | SELECT directed_by FROM table_11694832_1 WHERE us_viewers__millions_ = "2.06" |
I want to know the highest silver for total of 4 for poland and gold less than 1 | CREATE TABLE table_51646 ("Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MAX("Silver") FROM table_51646 WHERE "Total" = '4' AND "Nation" = 'poland' AND "Gold" < '1' |
What is the sum of gold medals won by teams that won 5 total medals and fewer than 2 bronze medals? | CREATE TABLE table_name_23 (gold INTEGER,total VARCHAR,bronze VARCHAR) | SELECT SUM(gold) FROM table_name_23 WHERE total = 5 AND bronze < 2 |
The film titled Bosko's fox hunt had what as the smallest production number? | CREATE TABLE table_65237 ("Title" text,"Series" text,"Characters" text,"Production Num." real,"Release date" text) | SELECT MIN("Production Num.") FROM table_65237 WHERE "Title" = 'bosko''s fox hunt' |
What's the time/retired for constructor source:? | CREATE TABLE table_name_89 (time_retired VARCHAR,constructor VARCHAR) | SELECT time_retired FROM table_name_89 WHERE constructor = "source:" |
For those employees who did not have any job in the past, give me the comparison about the average of manager_id over the hire_date bin hire_date by weekday, could you list the average of manager id in asc order? | CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE regions (REGIO... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_ID) |
Who drove the grid 10 car? | CREATE TABLE table_77757 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT "Driver" FROM table_77757 WHERE "Grid" = '10' |
give me the number of patients whose marital status is married and year of death is less than or equal to 2112? | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.dod_year <= "2112.0" |
Who is the lead for the team from Saskatoon, Saskatchewan? | CREATE TABLE table_name_84 (lead VARCHAR,home VARCHAR) | SELECT lead FROM table_name_84 WHERE home = "saskatoon, saskatchewan" |
What is the average snatch score of body builders? | CREATE TABLE body_builder (body_builder_id number,people_id number,snatch number,clean_jerk number,total number)CREATE TABLE people (people_id number,name text,height number,weight number,birth_date text,birth_place text) | SELECT AVG(snatch) FROM body_builder |
What is the 3rd Liga from 2010-11? | CREATE TABLE table_name_41 (date VARCHAR) | SELECT 3 AS rd_liga_3rd FROM table_name_41 WHERE date = "2010-11" |
recent papers by subhasis chaudhuri | CREATE TABLE writes (paperid int,authorid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREA... | SELECT DISTINCT keyphrase.keyphrasename, paper.year FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'subhasis chaudhuri' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.pape... |
how many times is the fuel propulsion is cng? | CREATE TABLE table_10007452_3 (fleet_series__quantity_ VARCHAR,fuel_propulsion VARCHAR) | SELECT COUNT(fleet_series__quantity_) FROM table_10007452_3 WHERE fuel_propulsion = "CNG" |
what is the number of patients whose admission year is less than 2111 and lab test fluid is ascites? | 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 text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2111" AND lab.fluid = "Ascites" |
What were the total number of Events, when the Top-5 was less than 2, and when the Top-25 was less than 3? | CREATE TABLE table_6885 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real) | SELECT COUNT("Events") FROM table_6885 WHERE "Top-5" < '2' AND "Top-25" < '3' |
What are the phone numbers for each employee, and count them by a bar chart, sort in ascending by the y-axis please. | CREATE TABLE InvoiceLine (InvoiceLineId integer,InvoiceId integer,TrackId integer,UnitPrice decimal(10,2),Quantity integer)CREATE TABLE Artist (ArtistId integer,Name varchar(120))CREATE TABLE Album (AlbumId integer,Title varchar(160),ArtistId integer)CREATE TABLE Genre (GenreId integer,Name varchar(120))CREATE TABLE Cu... | SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY COUNT(Phone) |
Tell me the nominated work larger than 2011 | CREATE TABLE table_name_54 (nominated_work VARCHAR,year INTEGER) | SELECT nominated_work FROM table_name_54 WHERE year > 2011 |
Which Attendance has a Round of 52, and a Home of s dert lje sk? | CREATE TABLE table_13417 ("Round" real,"Date" text,"Home" text,"Result" text,"Visitor" text,"Venue" text,"Attendance" real) | SELECT MIN("Attendance") FROM table_13417 WHERE "Round" = '52' AND "Home" = 'södertälje sk' |
give me the number of patients whose year of birth is less than 2130 and diagnoses short title is pressure ulcer, stage iv? | 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 text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2130" AND diagnoses.short_title = "Pressure ulcer, stage IV" |
What was the earliest year where USL PDL played in 3rd, Southeast season? | CREATE TABLE table_2402864_1 (year INTEGER,regular_season VARCHAR,league VARCHAR) | SELECT MIN(year) FROM table_2402864_1 WHERE regular_season = "3rd, Southeast" AND league = "USL PDL" |
What class did eddie cheever raul boesel race in? | CREATE TABLE table_67859 ("Year" real,"Team" text,"Co-Drivers" text,"Class" text,"Laps" real,"Pos." text,"Class Pos." text) | SELECT "Class" FROM table_67859 WHERE "Co-Drivers" = 'eddie cheever raul boesel' |
How many points did the Weslake v12 get in 1966? | CREATE TABLE table_name_28 (points INTEGER,engine VARCHAR,year VARCHAR) | SELECT MAX(points) FROM table_name_28 WHERE engine = "weslake v12" AND year < 1966 |
what is average days of hospital stay of patients whose admission location is phys referral/normal deli? | 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,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla... | SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" |
what is the competition played in budva against italy? | CREATE TABLE table_70843 ("Year" real,"Competition" text,"Town" text,"Opponent" text,"Final score" text) | SELECT "Competition" FROM table_70843 WHERE "Town" = 'budva' AND "Opponent" = 'italy' |
dates of only poll in which astorino polled better than 25 % | CREATE TABLE table_204_481 (id number,"poll source" text,"date(s)\nadministered" text,"sample\nsize" number,"margin of\nerror" text,"andrew\ncuomo (d)" text,"rob\nastorino (r)" text,"other" text,"undecided" text) | SELECT "date(s)\nadministered" FROM table_204_481 WHERE "rob\nastorino (r)" > 25 |
Which artist had a place larger than 1 with 229 points? | CREATE TABLE table_36724 ("Draw" real,"Artist" text,"Song" text,"Points" real,"Place" real) | SELECT "Artist" FROM table_36724 WHERE "Place" > '1' AND "Points" = '229' |
What is Result, when Original Title is 'Ti nm Ch f ng ( )'? | CREATE TABLE table_49489 ("Year (Ceremony)" text,"Film title used in nomination" text,"Original title" text,"Director" text,"Result" text) | SELECT "Result" FROM table_49489 WHERE "Original title" = 'tiānmǎ cháfáng (天馬茶房)' |
What is the sum of the yr plyf of coach ed robinson, who has a G plyf of 0? | CREATE TABLE table_44736 ("Coach" text,"First Yr" real,"Last Yr" real,"W-L%" real,"G > .500" real,"Yr plyf" real,"G plyf" real,"W plyf" real,"L plyf" real) | SELECT SUM("Yr plyf") FROM table_44736 WHERE "G plyf" = '0' AND "Coach" = 'ed robinson' |
Who has a walking data of 3:10:48+? | CREATE TABLE table_name_11 (athlete VARCHAR,data VARCHAR) | SELECT athlete FROM table_name_11 WHERE data = "3:10:48+" |
Who were the sideline reporter(s) in 2011? | CREATE TABLE table_4563 ("Year" real,"Network" text,"Play-by-play" text,"Color commentator(s)" text,"Sideline reporter(s)" text) | SELECT "Sideline reporter(s)" FROM table_4563 WHERE "Year" = '2011' |
A bar chart for finding the number of the latest logon date of the students whose family name is 'Jaskolski' or 'Langosh', and I want to show y axis in descending order. | CREATE TABLE Courses (course_id INTEGER,author_id INTEGER,subject_id INTEGER,course_name VARCHAR(120),course_description VARCHAR(255))CREATE TABLE Students (student_id INTEGER,date_of_registration DATETIME,date_of_latest_logon DATETIME,login_name VARCHAR(40),password VARCHAR(10),personal_name VARCHAR(40),middle_name VA... | SELECT date_of_latest_logon, COUNT(date_of_latest_logon) FROM Students WHERE family_name = "Jaskolski" OR family_name = "Langosh" ORDER BY COUNT(date_of_latest_logon) DESC |
how many patients whose diagnoses long title is hypoxemia and lab test fluid is blood? | 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 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.long_title = "Hypoxemia" AND lab.fluid = "Blood" |
Name the most 3 credits | CREATE TABLE table_19610 ("Hand" text,"1 credit" real,"2 credits" real,"3 credits" real,"4 credits" real,"5 credits" real) | SELECT MIN("3 credits") FROM table_19610 |
Top SOF users in Munich. | CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDa... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_id", (CASE WHEN DisplayName LIKE '%arbar%zha%' THEN '|_' + DisplayName + '_|' ELSE DisplayName END) AS DisplayName, Reputation, Location FROM Users WHERE (LOWER(Location) LIKE '%munich%' OR LOWER(Location) LIKE '%muenchen%' OR LOWER(Location) LIKE ... |
Which home team has a venue of windy hill? | CREATE TABLE table_56513 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team" FROM table_56513 WHERE "Venue" = 'windy hill' |
Find the different first names and cities of the students who have allergy to milk or cat. | CREATE TABLE Student (fname VARCHAR,city_code VARCHAR,stuid VARCHAR)CREATE TABLE Has_Allergy (stuid VARCHAR,Allergy VARCHAR) | SELECT DISTINCT T1.fname, T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = "Milk" OR T2.Allergy = "Cat" |
On what date did the Democratic governor that had Wallace Crossley as lieutenant governor take office? | CREATE TABLE table_64974 ("Governor" text,"Took office" text,"Left office" text,"Party" text,"Lieutenant Governor" text,"Terms" text) | SELECT "Took office" FROM table_64974 WHERE "Party" = 'democratic' AND "Lieutenant Governor" = 'wallace crossley' |
what are the four most frequently ordered procedures for patients who also received vasodilating agent - iv - labetalol before within 2 months in 2105? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosi... | 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 = 'vasodilating agent - iv - labetalol' AND... |
What is the season for series 81? | CREATE TABLE table_52503 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Original air date" text,"Production code" text) | SELECT "Season #" FROM table_52503 WHERE "Series #" = '81' |
Get Comments on all the posts created on or after Jan 1 2016. | 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 PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate... | SELECT Comments.Id, Comments.PostId, Posts.PostTypeId, Comments.Score, Comments.Text, Comments.CreationDate, Posts.CreationDate, Posts.AnswerCount, Posts.CommentCount, Users.Id, Users.Reputation, Users.Views, Users.UpVotes, Users.DownVotes FROM Comments, Users, Posts WHERE Comments.UserId = Users.Id AND Posts.Id = Comm... |
What is Sum of Round, when College/Junior/Club Team is Brandon Wheat Kings ( WHL ), when Player is Mike Perovich (D), and when Pick is less than 23? | CREATE TABLE table_47916 ("Round" real,"Pick" real,"Player" text,"Nationality" text,"College/Junior/Club Team" text) | SELECT SUM("Round") FROM table_47916 WHERE "College/Junior/Club Team" = 'brandon wheat kings ( whl )' AND "Player" = 'mike perovich (d)' AND "Pick" < '23' |
what was patient 19175's weight the last time during the previous month? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id ... | 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 = 19175)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'... |
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and code , and group by attribute founder, order X-axis from low to high order. | 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.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name |
What tournament is played on a carpet surface? | CREATE TABLE table_name_99 (tournament VARCHAR,surface VARCHAR) | SELECT tournament FROM table_name_99 WHERE surface = "carpet" |
How many players have an affiliation with University of Maryland? | CREATE TABLE table_25518547_2 (player VARCHAR,affiliation VARCHAR) | SELECT COUNT(player) FROM table_25518547_2 WHERE affiliation = "University of Maryland" |
What is the episode # of the episode that originally aired on January 21, 2001? | CREATE TABLE table_name_95 (episode__number VARCHAR,original_airdate VARCHAR) | SELECT episode__number FROM table_name_95 WHERE original_airdate = "january 21, 2001" |
What is the average Total when the ship was l tzow, with a 13.5-inch/1400lb smaller than 0? | CREATE TABLE table_41096 ("Ship" text,"13.5-inch/1400lb" real,"13.5-inch/1250lb" real,"12-inch" real,"Total" real) | SELECT AVG("Total") FROM table_41096 WHERE "Ship" = 'lützow' AND "13.5-inch/1400lb" < '0' |
What is the 1994 finish in the event that had a 1998 finish of 2R? | CREATE TABLE table_47039 ("Tournament" text,"1990" text,"1991" text,"1992" text,"1993" text,"1994" text,"1995" text,"1996" text,"1997" text,"1998" text,"1999" text,"2000" text,"2001" text,"Career SR" text,"Career Win-Loss" text) | SELECT "1994" FROM table_47039 WHERE "1998" = '2r' |
What is the type of institution in Kent State University? | CREATE TABLE table_261946_3 (type VARCHAR,location__all_in_ohio_ VARCHAR) | SELECT type FROM table_261946_3 WHERE location__all_in_ohio_ = "Kent" |
What's the type of the school whose students are nicknamed Chargers? | CREATE TABLE table_1969577_3 (type VARCHAR,nickname VARCHAR) | SELECT type FROM table_1969577_3 WHERE nickname = "Chargers" |
What is rank of player Charles Eady and a Bowling of 12/63? | CREATE TABLE table_name_2 (rank VARCHAR,player VARCHAR,bowling VARCHAR) | SELECT rank FROM table_name_2 WHERE player = "charles eady" AND bowling = "12/63" |
What club has less than 10 losses, less than 55 goals, and 13 wins? | CREATE TABLE table_12151 ("Position" real,"Club" text,"Played" real,"Points" real,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Goal Difference" real) | SELECT "Club" FROM table_12151 WHERE "Losses" < '10' AND "Goals for" < '55' AND "Wins" = '13' |
how much does a drug called atazanavir cost. | CREATE TABLE d_labitems (row_id number,itemid number,label 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 diagnoses_icd (row_id number,subject_id number,hadm_... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'atazanavir') |
what's the years for rockets where position is guard / forward | CREATE TABLE table_11734041_20 (years_for_rockets VARCHAR,position VARCHAR) | SELECT years_for_rockets FROM table_11734041_20 WHERE position = "Guard / Forward" |
how many patients whose insurance is medicaid and procedure long title is hemodialysis? | 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 text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.long_title = "Hemodialysis" |
Name the date for broadcast fsn | CREATE TABLE table_29060 ("Date" text,"Time" text,"Visiting team" text,"Home team" text,"Site" text,"Broadcast" text,"Result" text,"Attendance" real) | SELECT "Date" FROM table_29060 WHERE "Broadcast" = 'FSN' |
when was the first time that patient 004-86136 got a urine output today? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE microlab (microlabid number,patientunitstayid number,cul... | 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 = '004-86136')) AND intakeoutput.cellpath LIKE '%output%... |
what was the maximum value of patient 028-42654's -eos until 12/2102? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,... | SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-42654')) AND lab.labname = '-eos' AND STRFTIME('%y-%m', lab.labresulttime) <= ... |
Show all video games with type Collectible card game. | CREATE TABLE video_games (gameid number,gname text,gtype text)CREATE TABLE sportsinfo (stuid number,sportname text,hoursperweek number,gamesplayed number,onscholarship text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE plays_games (s... | SELECT gname FROM video_games WHERE gtype = "Collectible card game" |
What is Actor, when Role is 'Kate Manfredi'? | CREATE TABLE table_9791 ("Actor" text,"Role" text,"Status" text,"Number Of Episodes" text,"Notes" text) | SELECT "Actor" FROM table_9791 WHERE "Role" = 'kate manfredi' |
Anyone teach 489 other than Prof. Joshua Gottlieb ? | CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE instructor (instructor... | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 489 AND NOT instructor.name LIKE '%Joshua Gottlieb%' AND offering_instructor.instructor_id = instructor.instructor_id AND of... |
What is found in the Built column of the locomotive with 0-4-0 wheels that is still in service? | CREATE TABLE table_51810 ("Name" text,"Built" text,"Wheels" text,"Fuel/ Trans" text,"Status" text,"Colour" text) | SELECT "Built" FROM table_51810 WHERE "Wheels" = '0-4-0' AND "Status" = 'in service' |
Who had the opponent of Lenka Cenkov kate ina i kov in the final? | CREATE TABLE table_59450 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponents in the final" text,"Score in the final" text) | SELECT "Partner" FROM table_59450 WHERE "Opponents in the final" = 'lenka cenková kateřina šišková' |
What is the coverage of relay 5kw of dyfj-tv? | CREATE TABLE table_12379297_1 (coverage__transmitter_site_ VARCHAR,callsign VARCHAR,station_type VARCHAR,power__kw_ VARCHAR) | SELECT coverage__transmitter_site_ FROM table_12379297_1 WHERE station_type = "Relay" AND power__kw_ = "5kW" AND callsign = "DYFJ-TV" |
triglycerides greater than or equal to 500 mg / dl | CREATE TABLE table_dev_8 ("id" int,"systolic_blood_pressure_sbp" int,"heart_disease" bool,"diastolic_blood_pressure_dbp" int,"coronary_artery_disease_cad" bool,"triglyceride_tg" float,"hypertension" bool,"NOUSE" float) | SELECT * FROM table_dev_8 WHERE triglyceride_tg >= 500 |
Which series number had 1.98 million viewers? | CREATE TABLE table_24931 ("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 MIN("No. in series") FROM table_24931 WHERE "U.S. viewers (million)" = '1.98' |
find the number of patients diagnosed with blood in stool had the drug route as replace. | 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 diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | 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.long_title = "Blood in stool" AND prescriptions.route = "REPLACE" |
What is the smallest number of innings with a strike rate of 72.05 and under 297 balls faced? | CREATE TABLE table_name_89 (innings INTEGER,sr VARCHAR,balls_faced VARCHAR) | SELECT MIN(innings) FROM table_name_89 WHERE sr = 72.05 AND balls_faced < 297 |
What's Eli Bremer's fencing score? | CREATE TABLE table_12407546_1 (fencing VARCHAR,athlete__noc_ VARCHAR) | SELECT fencing FROM table_12407546_1 WHERE athlete__noc_ = "Eli Bremer" |
Show the most common type code across products. | CREATE TABLE Products (Product_Type_Code VARCHAR) | SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(*) DESC LIMIT 1 |
provide the number of patients whose insurance is government and procedure long title is closed [needle] biopsy of tongue? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Closed [needle] biopsy of tongue" |
What years in Orlando have the United States as the nationality, with concord hs as the school/club team? | CREATE TABLE table_76058 ("Player" text,"Nationality" text,"Position" text,"Years in Orlando" text,"School/Club Team" text) | SELECT "Years in Orlando" FROM table_76058 WHERE "Nationality" = 'united states' AND "School/Club Team" = 'concord hs' |
Which 30-day Pass has a Base Fare of $3? | CREATE TABLE table_55000 ("Fare Categories" text,"Base Fares" text,"Day Pass" text,"7-Day Pass" text,"30-Day Pass" text) | SELECT "30-Day Pass" FROM table_55000 WHERE "Base Fares" = '$3' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.