instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
what is the number of patients whose primary disease is squamous cell carcinoma oral tongue/sda and year of death is less than or equal to 2131?
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 lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA" AND demographic.dod_year <= "2131.0"
With the population in 2005 of 572, what is the former name?
CREATE TABLE table_24239 ("Nr." real,"District" text,"Former Name" text,"Area (ha)" real,"Population (2005)" real,"No. of villages" real,"Density persons / ha" text)
SELECT "Former Name" FROM table_24239 WHERE "Population (2005)" = '572'
give me a good arabic restaurant on buchanan in san francisco ?
CREATE TABLE geographic (city_name varchar,county varchar,region varchar)CREATE TABLE restaurant (id int,name varchar,food_type varchar,city_name varchar,rating "decimal)CREATE TABLE location (restaurant_id int,house_number int,street_name varchar,city_name varchar)
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND location.street_name = 'buchanan' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
What party is the winner K. Anbazhagan from?
CREATE TABLE table_22756549_1 (party VARCHAR,winner VARCHAR)
SELECT party AS a FROM table_22756549_1 WHERE winner = "K. Anbazhagan"
What nationality is Daryn Fersovich?
CREATE TABLE table_38747 ("Round" real,"Player" text,"Position" text,"Nationality" text,"College/Junior/Club Team (League)" text)
SELECT "Nationality" FROM table_38747 WHERE "Player" = 'daryn fersovich'
In the next 6 semesters name the classes that are offered ?
CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,en...
SELECT DISTINCT course.name, course.number, semester.semester, semester.year FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'FA' AND semester.year = 2017) OR (semester.semester = 'FA' AND semester.year = 2018) OR (semester.semester = 'WN' AND se...
Tell me the doubles W-L for player of laurynas grigelis
CREATE TABLE table_name_91 (doubles_w_l VARCHAR,player VARCHAR)
SELECT doubles_w_l FROM table_name_91 WHERE player = "laurynas grigelis"
What is the lowest number of against of NTFA Div 2 Fingal Valley?
CREATE TABLE table_75327 ("NTFA Div 2" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real)
SELECT MIN("Against") FROM table_75327 WHERE "NTFA Div 2" = 'fingal valley'
provide the number of patients whose year of death is less than or equal to 2180 and procedure icd9 code is 4105?
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 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.dod_year <= "2180.0" AND procedures.icd9_code = "4105"
how much do the -monos actually cost?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = '-monos')
What is the highest week when the game site was Verizon Wireless Arena, and the result was w 59 42?
CREATE TABLE table_name_69 (week INTEGER,game_site VARCHAR,result VARCHAR)
SELECT MAX(week) FROM table_name_69 WHERE game_site = "verizon wireless arena" AND result = "w 59–42"
number of races not finished
CREATE TABLE table_203_270 (id number,"year" number,"competition" text,"venue" text,"position" text,"event" text,"notes" text)
SELECT COUNT(*) FROM table_203_270 WHERE "position" IS NULL
Date first comment was posted at.
CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PendingFlags (Id num...
SELECT MIN(CreationDate) FROM Comments
What is Winner, when Pole Position is Ben Spies, and when Date is Elkhart Lake, Wisconsin?
CREATE TABLE table_name_41 (winner VARCHAR,pole_position VARCHAR,date VARCHAR)
SELECT winner FROM table_name_41 WHERE pole_position = "ben spies" AND date = "elkhart lake, wisconsin"
Who won gold in the games where Pan Cheng-Tsung won silver?
CREATE TABLE table_name_76 (gold VARCHAR,silver VARCHAR)
SELECT gold FROM table_name_76 WHERE silver = "pan cheng-tsung"
For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the sum of manager_id bin hire_date by weekday, and visualize them by a bar chart, and could you rank total number of manager id in desc order?
CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))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 (LOCAT...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(MANAGER_ID) DESC
Which Democrtic candidate ran against the Socialist candidate Edna Mitchell Blue?
CREATE TABLE table_42091 ("Office" text,"Democratic ticket" text,"Republican ticket" text,"American Labor ticket" text,"Socialist ticket" text)
SELECT "Democratic ticket" FROM table_42091 WHERE "Socialist ticket" = 'edna mitchell blue'
I want the trailers for motors of 145
CREATE TABLE table_52220 ("Year" text,"Builder" text,"Motors" text,"Trailers" text,"Control Trailers" text)
SELECT "Trailers" FROM table_52220 WHERE "Motors" = '145'
uncontrolled blood pressure and / or blood pressure above 140 / 90
CREATE TABLE table_train_117 ("id" int,"mini_mental_state_examination_mmse" int,"systolic_blood_pressure_sbp" int,"renal_disease" bool,"total_serum_protein" int,"diastolic_blood_pressure_dbp" int,"geriatric_depression_scale_gds" int,"serum_creatinine" float,"uncontrolled_blood_pressure" bool,"NOUSE" float)
SELECT * FROM table_train_117 WHERE uncontrolled_blood_pressure = 1 OR systolic_blood_pressure_sbp >= 140 OR diastolic_blood_pressure_dbp >= 90
how many patients whose year of birth is less than 1846 and drug type is additive?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "1846" AND prescriptions.drug_type = "ADDITIVE"
Who did the most high rebounds in the game 24?
CREATE TABLE table_11961582_4 (high_rebounds VARCHAR,game VARCHAR)
SELECT high_rebounds FROM table_11961582_4 WHERE game = 24
Can you tell me the highest Gold that has the Bronze smaller than 1, and the Total larger than 4?
CREATE TABLE table_name_87 (gold INTEGER,bronze VARCHAR,total VARCHAR)
SELECT MAX(gold) FROM table_name_87 WHERE bronze < 1 AND total > 4
What is the total number of rounds of the player with a pick of 20?
CREATE TABLE table_61386 ("Draft" real,"Round" real,"Pick" real,"Player" text,"Nationality" text)
SELECT COUNT("Round") FROM table_61386 WHERE "Pick" = '20'
provide the number of patients whose diagnoses short title is late ef-hemplga side nos and lab test category is hematology?
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 = "Late ef-hemplga side NOS" AND lab."CATEGORY" = "Hematology"
Which location had a year over 2006?
CREATE TABLE table_name_68 (location VARCHAR,year INTEGER)
SELECT location FROM table_name_68 WHERE year > 2006
Which Opponent had an Attendance of 78,883?
CREATE TABLE table_14133 ("Week" real,"Date" text,"Opponent" text,"Result" text,"TV Time" text,"Attendance" text)
SELECT "Opponent" FROM table_14133 WHERE "Attendance" = '78,883'
Which class has a part 2 of halp war ?
CREATE TABLE table_name_14 (class VARCHAR,part_2 VARCHAR)
SELECT class FROM table_name_14 WHERE part_2 = "halp warþ"
When chauncey billups (4) has the highest amount of assists who has the highest amount of points?
CREATE TABLE table_25872 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "High points" FROM table_25872 WHERE "High assists" = 'Chauncey Billups (4)'
How many spectators attended the game on 11/09/1935?
CREATE TABLE table_76955 ("Date" text,"Opponent" text,"Site" text,"Result" text,"Attendance" text)
SELECT "Attendance" FROM table_76955 WHERE "Date" = '11/09/1935'
what is the number of patients whose item id is 51466 and lab test abnormal status is abnormal?
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,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51466" AND lab.flag = "abnormal"
Which April has a Game of 84
CREATE TABLE table_35355 ("Game" real,"April" real,"Opponent" text,"Score" text,"Record" text,"Points" real)
SELECT MAX("April") FROM table_35355 WHERE "Game" = '84'
Name the note for catalog of 32xa-106
CREATE TABLE table_name_73 (note VARCHAR,catalog VARCHAR)
SELECT note FROM table_name_73 WHERE catalog = "32xa-106"
Let me know the route of administration of the medication with drug code ISOS10.
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 prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "ISOS10"
Name the volume for co 2 for 168 g/km
CREATE TABLE table_22012 ("Name" text,"Volume" text,"Engine" text,"Fuel" text,"Output" text,"Torque" text,"Engine ID code(s)" text,"0\u2013100km/h,s" text,"Top speed" text,"CO 2" text,"Years" text)
SELECT "Volume" FROM table_22012 WHERE "CO 2" = '168 g/km'
Name the average yeara for engine of renault v10 with points more than 4
CREATE TABLE table_name_19 (year INTEGER,engine VARCHAR,points VARCHAR)
SELECT AVG(year) FROM table_name_19 WHERE engine = "renault v10" AND points > 4
What is the average ANSI code for the town of Sherman and the smaller of the water area in square miles than 0.005?
CREATE TABLE table_62965 ("Township" text,"County" text,"Pop. (2010)" real,"Land (sqmi)" real,"Water (sqmi)" real,"Latitude" real,"Longitude" real,"GEO ID" real,"ANSI code" real)
SELECT AVG("ANSI code") FROM table_62965 WHERE "Township" = 'sherman' AND "Water (sqmi)" < '0.005'
What is the time for the second qualification where the first qualification time was 1:21.523?
CREATE TABLE table_name_21 (qual_2 VARCHAR,qual_1 VARCHAR)
SELECT qual_2 FROM table_name_21 WHERE qual_1 = "1:21.523"
Top 250 Reputation Holder From India.
CREATE TABLE ReviewTaskStates (Id number,Name text,Description 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 T...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%Pakistan%' OR UPPER(Location) LIKE '%Pak' ORDER BY Reputation DESC LIMIT 250
What locale has the skip Colleen Jones?
CREATE TABLE table_1117 ("Locale" text,"Skip" text,"W" real,"L" real,"PF" real,"PA" real,"Ends Won" real,"Ends Lost" real,"Blank Ends" real,"Stolen Ends" real,"Shot Pct." real)
SELECT "Locale" FROM table_1117 WHERE "Skip" = 'Colleen Jones'
what is average age of patients whose marital status is widowed and admission type is urgent?
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,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.admission_type = "URGENT"
what ground transportation is available from the PITTSBURGH airport to downtown and how much does it cost
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 ground_service.ground_fare, ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_code = airport_service.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_name = 'P...
What is the number of monarchs that had Yan Maw la Mon as the heir?
CREATE TABLE table_26460435_5 (monarch VARCHAR,heir VARCHAR)
SELECT COUNT(monarch) FROM table_26460435_5 WHERE heir = "Yan Maw La Mon"
What is the episode title that had a US viewership of 8.16?
CREATE TABLE table_27183 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (millions)" text)
SELECT "Title" FROM table_27183 WHERE "U.S. viewers (millions)" = '8.16'
Show the number of delegates in each committee with a bar chart, and show by the bar from high to low please.
CREATE TABLE county (County_Id int,County_name text,Population real,Zip_code text)CREATE TABLE election (Election_ID int,Counties_Represented text,District int,Delegate text,Party int,First_Elected real,Committee text)CREATE TABLE party (Party_ID int,Year real,Party text,Governor text,Lieutenant_Governor text,Comptroll...
SELECT Committee, COUNT(Committee) FROM election GROUP BY Committee ORDER BY Committee DESC
What is the ICAO when the IATA is ist?
CREATE TABLE table_41852 ("City" text,"Country" text,"IATA" text,"ICAO" text,"Airport" text)
SELECT "ICAO" FROM table_41852 WHERE "IATA" = 'ist'
What is the original name of the song performed in Swedish?
CREATE TABLE table_name_70 (original_name VARCHAR,language VARCHAR)
SELECT original_name FROM table_name_70 WHERE language = "swedish"
Which chassis is from 1974 and was an entrant of Goldie Hexagon racing?
CREATE TABLE table_name_35 (chassis VARCHAR,year VARCHAR,entrant VARCHAR)
SELECT chassis FROM table_name_35 WHERE year = 1974 AND entrant = "goldie hexagon racing"
Comments on my questions containing the given phrase (case insensitive).
CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)...
SELECT c.Id AS "comment_link", c.Text, c.UserId AS "user_link", c.CreationDate FROM Comments AS c INNER JOIN Posts AS p ON c.PostId = p.Id WHERE (p.OwnerUserId = '##UserId?8297##') AND (c.Text LIKE '%##Word?chat##%' COLLATE Latin1_General_CI_AI) AND (p.PostTypeId = '##type?1##')
What is the Model of the Engine with 29 Seats Built in 1941 1942?
CREATE TABLE table_name_85 (model VARCHAR,seats VARCHAR,built VARCHAR)
SELECT model FROM table_name_85 WHERE seats = 29 AND built = "1941–1942"
give me the number of patients whose gender is f and primary disease is syncope;telemetry?
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 WHERE demographic.gender = "F" AND demographic.diagnosis = "SYNCOPE;TELEMETRY"
Name the copa libertadores 1992 for round of 16 and team of fluminense
CREATE TABLE table_15013825_8 (copa_libertadores_1992 VARCHAR,copa_conmebol_1992 VARCHAR,team VARCHAR)
SELECT copa_libertadores_1992 FROM table_15013825_8 WHERE copa_conmebol_1992 = "Round of 16" AND team = "Fluminense"
Which Against has a Position larger than 8, and Points larger than 9?
CREATE TABLE table_7444 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text)
SELECT "Against" FROM table_7444 WHERE "Position" > '8' AND "Points" > '9'
give me the number of patients whose diagnoses short title is ac posthemorrhag anemia and drug route is ng?
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,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Ac posthemorrhag anemia" AND prescriptions.route = "NG"
What is the source of a move from Swindon Town?
CREATE TABLE table_14626 ("Name" text,"Country" text,"Type" text,"Moving from" text,"Transfer window" text,"Ends" real,"Transfer fee" text,"Source" text)
SELECT "Source" FROM table_14626 WHERE "Moving from" = 'swindon town'
Questions by tag with score 1 or greater and answer score 4 or greater.
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 ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId nu...
SELECT q.Id AS "post_link", q.Tags, q.Score, q.Title, q.ClosedDate, (SELECT SUM(Score) FROM Posts AS A WHERE q.Id = A.ParentId AND A.Score > 0) AS asco FROM Posts AS q WHERE q.PostTypeId = 1 AND q.Score > 0 AND q.Tags LIKE '%<' + @Tag + '>%' AND (SELECT SUM(Score) FROM Posts AS A WHERE q.Id = A.ParentId AND A.Score > 0...
What is the total Money ( ) of Player of nick faldo?
CREATE TABLE table_62672 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money (\u00a3)" real)
SELECT SUM("Money ( \u00a3 )") FROM table_62672 WHERE "Player" = 'nick faldo'
What city of license has a value of k293bg for its call sign?
CREATE TABLE table_69636 ("Call sign" text,"Frequency MHz" real,"City of license" text,"ERP W" real,"Class" text,"FCC info" text)
SELECT "City of license" FROM table_69636 WHERE "Call sign" = 'k293bg'
What was the average attendance on October 12?
CREATE TABLE table_name_40 (attendance INTEGER,date VARCHAR)
SELECT AVG(attendance) FROM table_name_40 WHERE date = "october 12"
what was the name of the procedure that's been performed to patient 010-39202 two times during this month?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid numbe...
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
what is patient 035-11731's last heartrate on 11/08/last year?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetaken...
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 = '035-11731')) AND NOT vitalperiodic.heartrate IS NULL AND ...
what is maximum days of hospital stay of patients whose primary disease is hypoxia?
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 MAX(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "HYPOXIA"
When was the game in which Deron Williams (13) did the high assists played?
CREATE TABLE table_73526 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "Date" FROM table_73526 WHERE "High assists" = 'Deron Williams (13)'
What's the total number of points when the English translation is Long Live Life and the draw is less than 2?
CREATE TABLE table_65785 ("Draw" real,"Language" text,"Song" text,"English translation" text,"Place" real,"Points" real)
SELECT COUNT("Points") FROM table_65785 WHERE "English translation" = 'long live life' AND "Draw" < '2'
Which FCC info has a Frequency MHz larger than 102.3?
CREATE TABLE table_name_84 (fcc_info VARCHAR,frequency_mhz INTEGER)
SELECT fcc_info FROM table_name_84 WHERE frequency_mhz > 102.3
Who is the Winning Applicant of Block 10B in Derbyshire Area?
CREATE TABLE table_74565 ("Area" text,"Advertisement date" text,"Block" text,"Winning applicant" text,"Ensemble name" text)
SELECT "Winning applicant" FROM table_74565 WHERE "Block" = '10b' AND "Area" = 'derbyshire'
what team had the first pick in round 17 of the 1969 nfl draft ?
CREATE TABLE table_203_229 (id number,"pick #" number,"nfl team" text,"player" text,"position" text,"college" text)
SELECT "nfl team" FROM table_203_229 ORDER BY "pick #" LIMIT 1
Please show the industries of companies in descending order of the number of companies.
CREATE TABLE office_locations (building_id number,company_id number,move_in_year number)CREATE TABLE companies (id number,name text,headquarters text,industry text,sales_billion number,profits_billion number,assets_billion number,market_value_billion text)CREATE TABLE buildings (id number,name text,city text,height num...
SELECT industry FROM companies GROUP BY industry ORDER BY COUNT(*) DESC
Search for comments by a user with particular text.
CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE ReviewT...
SELECT Id AS "comment_link", Score, Text FROM Comments WHERE UPPER(Text) LIKE UPPER('%##CommentText##%') AND UserId = '##userId##' ORDER BY Score DESC
What shows at 1:00 pm when 4:00 pm shows local programs, and 8:00 am is The Early Show?
CREATE TABLE table_61198 ("7:00 am" text,"7:30 am" text,"8:00 am" text,"9:00 am" text,"11:00 am" text,"noon" text,"12:30 pm" text,"1:00 pm" text,"1:30 pm" text,"2:00 pm" text,"3:00 pm" text,"3:30 pm" text,"4:00 pm" text,"4:30 pm" text,"5:00 pm" text,"6:30 pm" text)
SELECT "1:00 pm" FROM table_61198 WHERE "4:00 pm" = 'local programs' AND "8:00 am" = 'the early show'
What is the id of the instructor who advises of all students from History department?
CREATE TABLE takes (id text,course_id text,sec_id text,semester text,year number,grade text)CREATE TABLE teaches (id text,course_id text,sec_id text,semester text,year number)CREATE TABLE course (course_id text,title text,dept_name text,credits number)CREATE TABLE department (dept_name text,building text,budget number)...
SELECT i_id FROM advisor AS T1 JOIN student AS T2 ON T1.s_id = T2.id WHERE T2.dept_name = 'History'
Who is the rider for Honda with a grid of 25?
CREATE TABLE table_44664 ("Rider" text,"Manufacturer" text,"Laps" text,"Time/Retired" text,"Grid" text)
SELECT "Rider" FROM table_44664 WHERE "Manufacturer" = 'honda' AND "Grid" = '25'
What nationality has a pick of 1?
CREATE TABLE table_name_49 (nationality VARCHAR,pick VARCHAR)
SELECT nationality FROM table_name_49 WHERE pick = "1"
What is the largest number of wickets when there are more than 630 maidens and a best of 7/72?
CREATE TABLE table_64324 ("Name" text,"Career" text,"Matches" real,"Overs" real,"Maidens" real,"Runs" real,"Wickets" real,"Average" real,"Best" text)
SELECT MAX("Wickets") FROM table_64324 WHERE "Maidens" > '630' AND "Best" = '7/72'
give me the number of patients whose drug code is kcl40i?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "KCL40I"
What school does John Crotty play for?
CREATE TABLE table_name_35 (school_club_team VARCHAR,player VARCHAR)
SELECT school_club_team FROM table_name_35 WHERE player = "john crotty"
Which Date has a Record of 8:39.49?
CREATE TABLE table_42248 ("Event" text,"Record" text,"Nation" text,"Date" text,"Venue" text)
SELECT "Date" FROM table_42248 WHERE "Record" = '8:39.49'
What is the Country with Reteconomy as the Television service?
CREATE TABLE table_76123 ("Television service" text,"Country" text,"Language" text,"Content" text,"HDTV" text,"Package/Option" text)
SELECT "Country" FROM table_76123 WHERE "Television service" = 'reteconomy'
Out of total number of patients treated with dexamethasone, how many of them died in or before 2112?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2112.0" AND prescriptions.drug = "Dexamethasone"
What are the number of days in 1945 where the constituent was heywood and radcliffe?
CREATE TABLE table_31977 ("Candidate" text,"Party" text,"Constituency" text,"Year" text,"Days" text)
SELECT "Days" FROM table_31977 WHERE "Year" = '1945' AND "Constituency" = 'heywood and radcliffe'
what are the top four most frequent diagnoses that patients were given within the same month after being diagnosed with intracranial injury - with loss of consciousness >24 hours since 1 year ago?
CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim...
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'intracranial injury - with loss of consc...
What is the height in ft and m of the regions bank building?
CREATE TABLE table_62095 ("Name" text,"Street address" text,"Years as tallest" text,"Height ft (m)" text,"Floors" real)
SELECT "Height ft (m)" FROM table_62095 WHERE "Name" = 'regions bank building'
What is the college/junior/club team (league) of the player who was pick number 130?
CREATE TABLE table_72511 ("Round" real,"Pick #" text,"Player" text,"Position" text,"Nationality" text,"College/junior/club team (league)" text)
SELECT "College/junior/club team (league)" FROM table_72511 WHERE "Pick #" = '130'
What was the state (class) where the new successor was formally installed on May 11, 1966?
CREATE TABLE table_22349 ("State (class)" text,"Vacator" text,"Reason for change" text,"Successor" text,"Date of successors formal installation" text)
SELECT "State (class)" FROM table_22349 WHERE "Date of successors formal installation" = 'May 11, 1966'
which symbol is listed at the top of the jamo column ?
CREATE TABLE table_203_119 (id number,"jamo" text,"hangul compatibility" text,"hangul jamo area" text,"hanyang private use" text,"halfwidth" text)
SELECT "jamo" FROM table_203_119 ORDER BY id LIMIT 1
What's the total enrollment in 57 Noble having a # and AA as the IHSAA Class?
CREATE TABLE table_name_95 (enrollment VARCHAR,_number___county VARCHAR,ihsaa_class VARCHAR)
SELECT COUNT(enrollment) FROM table_name_95 WHERE _number___county = "57 noble" AND ihsaa_class = "aa"
The release from Simply Vinyl label was on what date?
CREATE TABLE table_name_91 (date VARCHAR,label VARCHAR)
SELECT date FROM table_name_91 WHERE label = "simply vinyl"
what was the first time that patient 005-4044 had p.o. taken on the last icu visit?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,...
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 = '005-4044') AND NOT patient.unitdischargetime IS NULL ...
what is minimum age of patients whose death status is 0 and primary disease is t5 fracture?
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 MIN(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "T5 FRACTURE"
Show the number of document types.
CREATE TABLE Ref_document_types (Id VARCHAR)
SELECT COUNT(*) FROM Ref_document_types
count the number of patients whose admission type is urgent and ethnicity is american indian/alaska natives.
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,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE"
What was the week 14 opponent for the year with a week 10 opponent of Michigan State (8-2)?
CREATE TABLE table_38963 ("Week 2 Sept 7" text,"Week 3 Sept 14" text,"Week 4 Sept 21" text,"Week 5 Sept 28" text,"Week 6 Oct 5" text,"Week 7 Oct 12" text,"Week 10 Nov 2" text,"Week 12 Nov 16" text,"Week 14 Nov 30" text,"Week 15 Dec 7" text,"Week 16 (Final) Jan 9" text)
SELECT "Week 14 Nov 30" FROM table_38963 WHERE "Week 10 Nov 2" = 'michigan state (8-2)'
How many staying councillors were there when the election result was larger than 0, the new council less than 27 and the party conservatives?
CREATE TABLE table_49066 ("Party" text,"Previous council" real,"Staying councillors" real,"Seats up for election" real,"Election result" real,"New council" real)
SELECT AVG("Staying councillors") FROM table_49066 WHERE "Election result" > '0' AND "Party" = 'conservatives' AND "New council" < '27'
What was the 2nd event aired on 8 June 2008?
CREATE TABLE table_name_32 (event_2 VARCHAR,air_date VARCHAR)
SELECT event_2 FROM table_name_32 WHERE air_date = "8 june 2008"
What is the date of week 8?
CREATE TABLE table_name_23 (date VARCHAR,week VARCHAR)
SELECT date FROM table_name_23 WHERE week = 8
how many of these members were elected in october ?
CREATE TABLE table_204_608 (id number,"name" text,"elected party" text,"constituency" text,"elected date" text,"military service" text)
SELECT COUNT("name") FROM table_204_608 WHERE "elected date" = 10
What losses have points for less than 1175, wins greater than 2, points against greater than 894, and 24 as the points?
CREATE TABLE table_name_84 (loses VARCHAR,points VARCHAR,points_against VARCHAR,points_for VARCHAR,wins VARCHAR)
SELECT loses FROM table_name_84 WHERE points_for < 1175 AND wins > 2 AND points_against > 894 AND points = 24
what is the grid when the time/retired is +27.112?
CREATE TABLE table_55673 ("Driver" text,"Constructor" text,"Laps" text,"Time/Retired" text,"Grid" text)
SELECT "Grid" FROM table_55673 WHERE "Time/Retired" = '+27.112'
who is the the writer(s) with original airdate being february 7, 2001
CREATE TABLE table_19052 ("#" real,"Episode title" text,"Writer(s)" text,"Director" text,"Prod. Code" text,"Original airdate" text)
SELECT "Writer(s)" FROM table_19052 WHERE "Original airdate" = 'February 7, 2001'
How many picks did Central State have before round 2?
CREATE TABLE table_name_29 (pick VARCHAR,school VARCHAR,round VARCHAR)
SELECT COUNT(pick) FROM table_name_29 WHERE school = "central state" AND round < 2
How many directors were in Season 2?
CREATE TABLE table_23827 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (in millions)" text)
SELECT COUNT("Directed by") FROM table_23827 WHERE "Season #" = '2'