instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
How many sprint points contribute to 2 total points? | CREATE TABLE table_name_27 (sprint_points VARCHAR,total_points VARCHAR) | SELECT sprint_points FROM table_name_27 WHERE total_points = "2" |
What is the country of cordier? | CREATE TABLE table_name_70 (country VARCHAR,name VARCHAR) | SELECT country FROM table_name_70 WHERE name = "cordier" |
find out the maximum age of male patients who were discharged to their homes. | 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 MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.discharge_location = "HOME" |
Reviews Over Time (per month). | CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate ... | SELECT DATEADD(DAY, -(DATEPART(DAY, rtr.CreationDate) % 30), rtr.CreationDate) AS "date", COUNT(rt.Id) AS "reviews_completed" FROM ReviewTasks AS rt INNER JOIN ReviewTaskResults AS rtr ON rtr.ReviewTaskId = rt.Id WHERE rt.ReviewTaskStateId = 2 GROUP BY DATEADD(DAY, -(DATEPART(DAY, rtr.CreationDate) % 30), rtr.CreationD... |
What is the total number of bronze medals for teams with less than 0 silver? | CREATE TABLE table_61258 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT COUNT("Bronze") FROM table_61258 WHERE "Silver" < '0' |
Check Post Id and Date covariance. | CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE FlagTypes (Id... | SELECT low.Id AS "post_link", low.Id AS LowId, low.CreationDate AS LowDate, hi.Id AS "high_link", hi.CreationDate AS HighDate FROM Posts AS low, Posts AS hi WHERE low.Id > hi.Id AND low.CreationDate < hi.CreationDate AND low.CreationDate > '1 jan 2012' AND hi.CreationDate > '1 jan 2012' |
Mean Expertise Contribution (MEC) in a 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... | WITH answers AS (SELECT a.OwnerUserId AS UserId, 1.0 / RANK() OVER (PARTITION BY q.Id ORDER BY a.Score DESC) AS utility, 1.0 * q.AnswerCount AS debatableness, 1.0 / RANK() OVER (PARTITION BY q.Id ORDER BY a.Score DESC) * q.AnswerCount / @tag_debate AS EC FROM Posts AS q JOIN Posts AS a ON q.Id = a.ParentId JOIN PostTag... |
what was the score of bert yancey | CREATE TABLE table_name_83 (score VARCHAR,player VARCHAR) | SELECT score FROM table_name_83 WHERE player = "bert yancey" |
Give me a bar chart for the total number of each dept name, I want to show by the the total number in ascending. | CREATE TABLE classroom (building varchar(15),room_number varchar(7),capacity numeric(4,0))CREATE TABLE student (ID varchar(5),name varchar(20),dept_name varchar(20),tot_cred numeric(3,0))CREATE TABLE section (course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0),building varchar(15),room_number v... | SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name ORDER BY COUNT(*) |
Which Selection has a College of texas a&m? | CREATE TABLE table_76470 ("Round" real,"Selection" real,"Player" text,"Position" text,"College" text) | SELECT SUM("Selection") FROM table_76470 WHERE "College" = 'texas a&m' |
In the 1936 summer Olympics what was the date of a match that ended with a score of 6-1? | CREATE TABLE table_name_33 (date VARCHAR,competition VARCHAR,score VARCHAR) | SELECT date FROM table_name_33 WHERE competition = "1936 summer olympics" AND score = "6-1" |
What position did Gene Stahl play | CREATE TABLE table_20816 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text) | SELECT "Position" FROM table_20816 WHERE "Player" = 'Gene Stahl' |
When was the station WLS-TV owned since? | CREATE TABLE table_22329326_1 (owned_since VARCHAR,station VARCHAR) | SELECT owned_since FROM table_22329326_1 WHERE station = "WLS-TV" |
What is the Rank of the Character with Tenure of 2011? | CREATE TABLE table_13071 ("Actor/actress" text,"Character" text,"Rank" text,"Tenure" text,"Episodes" text) | SELECT "Rank" FROM table_13071 WHERE "Tenure" = '2011' |
Which is the easiest class for the Core requirement ? | CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_cre... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co... |
Which stage has 15:17 as time? | CREATE TABLE table_21578303_2 (stage VARCHAR,time__eet_ VARCHAR) | SELECT stage FROM table_21578303_2 WHERE time__eet_ = "15:17" |
Accept rate by rep (only questions with good answers). | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE CloseA... | SELECT COUNT(*) / (SUM(CASE WHEN acc.Id != NULL THEN 1 ELSE 0 END) + 1) AS rate FROM Users INNER JOIN Posts AS q ON q.OwnerUserId = Users.Id INNER JOIN PostTags AS pt ON q.Id = pt.PostId INNER JOIN Tags AS t ON t.Id = pt.TagId LEFT OUTER JOIN Posts AS acc ON acc.Id = q.AcceptedAnswerId INNER JOIN Posts AS ans ON ans.Pa... |
what is average age of patients whose primary disease is copd exacerbation and year of death is less than 2158? | 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 AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "COPD EXACERBATION" AND demographic.dod_year < "2158.0" |
Which Runner(s)-up has a Date of may 19, 1973? | CREATE TABLE table_name_21 (runner_s__up VARCHAR,date VARCHAR) | SELECT runner_s__up FROM table_name_21 WHERE date = "may 19, 1973" |
what does fare code QX mean | CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)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,flig... | SELECT DISTINCT fare_basis_code FROM fare_basis WHERE fare_basis_code = 'QX' |
does patient 027-85328 produce any output (ml)-urethral catheter diana acuna, rn latex;straight-tip 14 fr. since 09/2105. | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,lab... | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-85328')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu... |
What is the lowest total for the silver less than 1, and a rank more than 5, more than 1 bronze? | CREATE TABLE table_38990 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MIN("Total") FROM table_38990 WHERE "Silver" < '1' AND "Rank" > '5' AND "Bronze" > '1' |
What is the time for the race with the United States? | CREATE TABLE table_name_63 (time VARCHAR,country VARCHAR) | SELECT time FROM table_name_63 WHERE country = "united states" |
What was the Bhofen #2 score and rank for the player whose GA-PA score and rank was 227.5 (19)? | CREATE TABLE table_19716 ("Rank" real,"Name" text,"Nationality" text,"Total points" text,"Oberstdorf (Rk)" text,"Ga-Pa (Rk)" text,"Bhofen#1 (Rk)" text,"Bhofen#2 (Rk)" text) | SELECT "Bhofen#2 (Rk)" FROM table_19716 WHERE "Ga-Pa (Rk)" = '227.5 (19)' |
calculate the difference between patient 8016's total input and the patient's output on last month/23. | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_id numbe... | 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 = 8016)) AND DATETIME(inputevents_cv.charttime, 'start of month') = DATETIME(CURRENT... |
What is the Average Qualifying Goals for Jack Froggatt where the Final Goals is greater than 0? | CREATE TABLE table_61310 ("Player" text,"Club" text,"Qualifying Goals" real,"Finals Goals" real,"Total Goals" real) | SELECT AVG("Qualifying Goals") FROM table_61310 WHERE "Player" = 'jack froggatt' AND "Finals Goals" > '0' |
A bar chart about what are the memories and carriers of phones?, and show by the total number in desc. | CREATE TABLE phone (Name text,Phone_ID int,Memory_in_G int,Carrier text,Price real)CREATE TABLE market (Market_ID int,District text,Num_of_employees int,Num_of_shops real,Ranking int)CREATE TABLE phone_market (Market_ID int,Phone_ID text,Num_of_stock int) | SELECT Carrier, AVG(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY AVG(Memory_in_G) DESC |
Name the number of ratings for bruce forsyth | CREATE TABLE table_29135051_2 (ratings VARCHAR,guest_s_ VARCHAR) | SELECT COUNT(ratings) FROM table_29135051_2 WHERE guest_s_ = "Bruce Forsyth" |
What is the molecular target listed under the compounded name of hemiasterlin (e7974) | CREATE TABLE table_17751 ("Clinical Status" text,"Compound Name" text,"Trademark" text,"Marine Organism \u03b1" text,"Chemical Class" text,"Molecular Target" text,"Clinical Trials \u03b2" text,"Disease Area" text) | SELECT "Molecular Target" FROM table_17751 WHERE "Compound Name" = 'Hemiasterlin (E7974)' |
Average question score for popular tags. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Tags (Id ... | SELECT T.TagName, T.Count AS tagCount, SUM(P.Score) / CAST(COUNT(P.Score) AS FLOAT) AS avgScore FROM Tags AS T JOIN PostTags AS PT ON PT.TagId = T.Id JOIN Posts AS P ON P.Id = PT.PostId WHERE T.Count > 10 AND P.PostTypeId = 1 GROUP BY T.TagName, T.Count ORDER BY avgScore DESC |
how many patients whose gender is f and lab test name is o2 flow? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.label = "O2 Flow" |
calculate the number of medications that were prescribed to patient 2482 in 2105. | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE ... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2482) AND STRFTIME('%y', prescriptions.startdate) = '2105' |
what was the last height of patient 027-149724 this month. | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE lab (labid number,patientunitstayid number,labna... | SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-149724') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month',... |
how many result with opponent being cleveland browns | CREATE TABLE table_14951643_1 (result VARCHAR,opponent VARCHAR) | SELECT COUNT(result) FROM table_14951643_1 WHERE opponent = "Cleveland Browns" |
what was the total urine output since 1118 days ago that patient 010-29887 had? | 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 microlab (microlabid number,patientunitstayid nu... | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-29887')) AND intakeoutput.celllabel = 'urine... |
What is the average training hours of all players? | CREATE TABLE tryout (pid number,cname text,ppos text,decision text)CREATE TABLE college (cname text,state text,enr number)CREATE TABLE player (pid number,pname text,ycard text,hs number) | SELECT AVG(hs) FROM player |
what's the first operational with programming being not programmable single purpose | CREATE TABLE table_72469 ("Name" text,"First operational" text,"Numeral system" text,"Computing mechanism" text,"Programming" text,"Turing complete" text) | SELECT "First operational" FROM table_72469 WHERE "Programming" = 'Not programmable—single purpose' |
What are the ids of the candidates that have an outcome code of Pass? | CREATE TABLE people_addresses (person_address_id number,person_id number,address_id number,date_from time,date_to time)CREATE TABLE student_course_attendance (student_id number,course_id number,date_of_attendance time)CREATE TABLE candidate_assessments (candidate_id number,qualification text,assessment_date time,asessm... | SELECT candidate_id FROM candidate_assessments WHERE asessment_outcome_code = "Pass" |
CASE Statement in WHERE clause renders query non-sargable?. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,D... | SELECT Id FROM Posts WHERE 1 = CASE WHEN Id = 4 THEN 1 WHEN Id = 6 THEN 1 ELSE 0 END |
Tell me the degree for chemistry 1965 | CREATE TABLE table_name_90 (degree VARCHAR,award_year VARCHAR,award VARCHAR) | SELECT degree FROM table_name_90 WHERE award_year = 1965 AND award = "chemistry" |
Tyne and Wear County has what total membership for their metropolitan area? | CREATE TABLE table_2273738_1 (metropolitan_area VARCHAR,county VARCHAR) | SELECT metropolitan_area FROM table_2273738_1 WHERE county = "Tyne and Wear" |
For those employees who did not have any job in the past, give me the comparison about the sum of manager_id over the job_id , and group by attribute job_id by a bar chart, I want to sort by the names from high to low. | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STAT... | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC |
which name is listed after alan smith ? | CREATE TABLE table_203_753 (id number,"rank" number,"name" text,"caps" number,"goals" number,"years" text) | SELECT "name" FROM table_203_753 WHERE id = (SELECT id FROM table_203_753 WHERE "name" = 'alan smith') + 1 |
Which species is male? | CREATE TABLE table_55845 ("Animal Name" text,"Species" text,"Books" text,"TV Series" text,"Gender" text,"TV Seasons" text) | SELECT "Species" FROM table_55845 WHERE "Gender" = 'male' |
give me the number of patients whose diagnoses long title is unspecified procedure as the cause of abnormal reaction of patient, or of later complication, without mention of misadventure at time of procedure and lab test abnormal status is delta? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Unspecified procedure as the cause of abnormal reaction of patient, or of later complication, without mention o... |
What 2011 GDP (PPP) billions of USD does Israel have? | CREATE TABLE table_2248784_4 (country VARCHAR) | SELECT 2011 AS _gdp__ppp__billions_of_usd FROM table_2248784_4 WHERE country = "Israel" |
how much is a diagnosis of fx astragalus-closed going to cost? | CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name 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)... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'fx astragalus-closed')) |
what is the number of silver medals won by italy ? | CREATE TABLE table_204_297 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "silver" FROM table_204_297 WHERE "nation" = 'italy' |
Who proceeded to the quarter final when the london irish were eliminated from competition? | CREATE TABLE table_28068063_3 (proceed_to_quarter_final VARCHAR,eliminated_from_competition VARCHAR) | SELECT proceed_to_quarter_final FROM table_28068063_3 WHERE eliminated_from_competition = "London Irish" |
What country was the golfer from who had a money amount of 45,000? | CREATE TABLE table_name_39 (country VARCHAR,money___$__ VARCHAR) | SELECT country FROM table_name_39 WHERE money___$__ = "45,000" |
What is the average number of top-10s for the major with 2 top-25s and fewer than 10 cuts made? | CREATE TABLE table_name_31 (top_10 INTEGER,top_25 VARCHAR,cuts_made VARCHAR) | SELECT AVG(top_10) FROM table_name_31 WHERE top_25 = 2 AND cuts_made < 10 |
what is the average amount of total hospital cost including congestive heart failure - diastolic during this year? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE treatment (treatmentid number,patientu... | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'congestive heart failure - diastolic')) AND ... |
Give me a bar chart that the X-axis is the date_moved_in and the Y-axis is Count them, please bin X-axis into Day of Week interval, list from high to low by the how many date moved in. | CREATE TABLE Residents_Services (resident_id INTEGER,service_id INTEGER,date_moved_in DATETIME,property_id INTEGER,date_requested DATETIME,date_provided DATETIME,other_details VARCHAR(255))CREATE TABLE Residents (resident_id INTEGER,property_id INTEGER,date_moved_in DATETIME,date_moved_out DATETIME,other_details VARCHA... | SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events ORDER BY COUNT(date_moved_in) DESC |
how much is the difference of heart rate in patient 14397 last measured on the last icu visit compared to the second to last value measured on the last icu visit? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE diagnoses_icd (row_id number... | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14397) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents... |
What is the date of the game held at Lahore? | CREATE TABLE table_38265 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Date" FROM table_38265 WHERE "Venue" = 'lahore' |
uncontrolled hypertension, defined as sustained blood pressure >= 180 / 110 mm hg ( systolic bp >= 180 mm hg and / or diastolic bp >= 110 mm hg ) prior to randomisation | CREATE TABLE table_test_11 ("id" int,"left_ventricular_ejection_fraction_lvef" int,"systolic_blood_pressure_sbp" int,"tachycardia" int,"bradycardia" int,"renal_disease" bool,"allergy_to_aspirin" bool,"temperature" float,"creatinine_clearance_cl" float,"diastolic_blood_pressure_dbp" int,"hypotension" bool,"serum_creatin... | SELECT * FROM table_test_11 WHERE hypertension = 1 OR systolic_blood_pressure_sbp >= 180 OR diastolic_blood_pressure_dbp >= 110 |
Which Team has a Score of 108-107? | CREATE TABLE table_43007 ("Game" real,"Date" text,"Team" text,"Score" text,"Location Attendance" text,"Record" text) | SELECT "Team" FROM table_43007 WHERE "Score" = '108-107' |
What college did Keith Shologan play for? | CREATE TABLE table_name_40 (college VARCHAR,player VARCHAR) | SELECT college FROM table_name_40 WHERE player = "keith shologan" |
Bar chart x axis meter 600 y axis id, sort X-axis in descending order. | CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 te... | SELECT meter_600, ID FROM swimmer ORDER BY meter_600 DESC |
How many Volume Numbers have the title of Darkness Falls? | CREATE TABLE table_75012 ("Vol. #" real,"Title" text,"Material collected" text,"Publication date" text,"ISBN" text) | SELECT SUM("Vol. #") FROM table_75012 WHERE "Title" = 'darkness falls' |
What is Name, when Builder is 'Kerr Stuart'? | CREATE TABLE table_62280 ("Name" text,"Builder" text,"Type" text,"Works Number" text,"Built" real) | SELECT "Name" FROM table_62280 WHERE "Builder" = 'kerr stuart' |
does patient 5905 have a male or female gender? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE d_items (row_id number,itemid number,label te... | SELECT patients.gender FROM patients WHERE patients.subject_id = 5905 |
what is the number of patients whose days of hospital stay is greater than 17 and procedure long title is other radiotherapeutic procedure? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "17" AND procedures.long_title = "Other radiotherapeutic procedure" |
Which player had a draft before 1975 and before round 6? | CREATE TABLE table_name_79 (player VARCHAR,draft VARCHAR,round VARCHAR) | SELECT player FROM table_name_79 WHERE draft < 1975 AND round < 6 |
how many times in this year has patient 012-14774 been to the hospital? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE intakeoutput (intakeoutputid number,pat... | SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '012-14774' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') |
What province does the Ruhuna Royals team come from? | CREATE TABLE table_19905183_1 (province VARCHAR,team VARCHAR) | SELECT province FROM table_19905183_1 WHERE team = "Ruhuna Royals" |
Which Geelong DFL has 8 losses and more than 4 wins? | CREATE TABLE table_62496 ("Geelong DFL" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real) | SELECT "Geelong DFL" FROM table_62496 WHERE "Wins" > '4' AND "Losses" = '8' |
what is the year when the role/episode is david duchovny? | CREATE TABLE table_name_82 (year VARCHAR,role_episode VARCHAR) | SELECT year FROM table_name_82 WHERE role_episode = "david duchovny" |
Name the indianapolis concerts for les minski | CREATE TABLE table_1590 ("Character" text,"Indianapolis Concerts" text,"Sarasota" text,"Broadway" text,"Brighton Cast" text) | SELECT "Indianapolis Concerts" FROM table_1590 WHERE "Sarasota" = 'Les Minski' |
What winning amount has himesh reshammiya as the contestant name? | CREATE TABLE table_name_51 (winning_amount VARCHAR,contestant_name VARCHAR) | SELECT winning_amount FROM table_name_51 WHERE contestant_name = "himesh reshammiya" |
What are the titles and directors of the films were never presented in China? | CREATE TABLE market (market_id number,country text,number_cities number)CREATE TABLE film_market_estimation (estimation_id number,low_estimate number,high_estimate number,film_id number,type text,market_id number,year number)CREATE TABLE film (film_id number,title text,studio text,director text,gross_in_dollar number) | SELECT title, director FROM film WHERE NOT film_id IN (SELECT film_id FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.market_id WHERE country = 'China') |
What is the second party where the first party is Tory and the year is 1820? | CREATE TABLE table_60788 ("Year" real,"First member" text,"First party" text,"Second member" text,"Second party" text) | SELECT "Second party" FROM table_60788 WHERE "First party" = 'tory' AND "Year" = '1820' |
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the sum of employee_id over the hire_date bin hire_date by time. | 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 employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JO... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) |
which club was represented the most ? | CREATE TABLE table_204_26 (id number,"name" text,"position" text,"birth date/age at start of campaign" text,"games in campaign" text,"club" text) | SELECT "club" FROM table_204_26 GROUP BY "club" ORDER BY COUNT(*) DESC LIMIT 1 |
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by time, and I want to order total number in desc order. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar... | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(EMPLOYEE_ID) DESC |
Which one is easiest , EECS 634 or EECS 592 ? | CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE comment_instru... | SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 634 OR course.number = 592) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ... |
Name the score for denver | CREATE TABLE table_27722734_11 (score VARCHAR,team VARCHAR) | SELECT score FROM table_27722734_11 WHERE team = "Denver" |
Count the number of local authorities by the local authority, and rank in desc by the x axis. | CREATE TABLE route (train_id int,station_id int)CREATE TABLE station (id int,network_name text,services text,local_authority text)CREATE TABLE weekly_weather (station_id int,day_of_week text,high_temperature int,low_temperature int,precipitation real,wind_speed_mph int)CREATE TABLE train (id int,train_number int,name t... | SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY local_authority DESC |
Creating a post through SEDE. | CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserI... | SELECT * FROM Posts WHERE Id = 28231 |
how much prize money (in USD) did bob lutz win | CREATE TABLE table_29302711_12 (prize_money__usd_ INTEGER,name VARCHAR) | SELECT MAX(prize_money__usd_) FROM table_29302711_12 WHERE name = "Bob Lutz" |
On what day was game 2 played? | CREATE TABLE table_64547 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location/Attendance" text,"Record" text) | SELECT "Date" FROM table_64547 WHERE "Game" = '2' |
what's the date of the birth of patient 7524? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE ... | SELECT patients.dob FROM patients WHERE patients.subject_id = 7524 |
Show order ids and the total quantity in each order. | CREATE TABLE product_categories (production_type_code text,product_type_description text,vat_rating number)CREATE TABLE invoice_line_items (order_item_id number,invoice_number number,product_id number,product_title text,product_quantity text,product_price number,derived_product_cost number,derived_vat_payable number,de... | SELECT order_id, SUM(product_quantity) FROM order_items GROUP BY order_id |
cryptography posts for specific langauge/tag. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId numb... | SELECT Posts.Id, REPLACE(REPLACE(REPLACE(Title, CHAR(10) + CHAR(13), '<br />'), CHAR(10), '<br />'), CHAR(13), '<br />') AS "title", Tags, ViewCount, AnswerCount, CommentCount, FavoriteCount, CreationDate, Score, REPLACE(REPLACE(REPLACE(Body, CHAR(10) + CHAR(13), '<br />'), CHAR(10), '<br />'), CHAR(13), '<br />') AS "... |
What is the total (kg when the bodyweight is more than 57.8, and the clean & jerk is less than 103? | CREATE TABLE table_name_94 (total__kg_ INTEGER,bodyweight VARCHAR,clean_ VARCHAR,_jerk VARCHAR) | SELECT SUM(total__kg_) FROM table_name_94 WHERE bodyweight > 57.8 AND clean_ & _jerk < 103 |
What is the Heat of the Player with a Rank of 18 or less and Result of 55.15? | CREATE TABLE table_66248 ("Rank" real,"Heat" real,"Name" text,"Nationality" text,"Result" text) | SELECT "Heat" FROM table_66248 WHERE "Rank" < '18' AND "Result" = '55.15' |
What was the attendance for week 15? | CREATE TABLE table_43530 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT "Attendance" FROM table_43530 WHERE "Week" = '15' |
What was the result of the friendly competition? | CREATE TABLE table_14700 ("Goal" real,"Date" text,"Score" text,"Result" text,"Competition" text) | SELECT "Result" FROM table_14700 WHERE "Competition" = 'friendly' |
heavy alcohol consumption ( > 21 drinks / week male , > 14 drinks / week female ) | CREATE TABLE table_dev_45 ("id" int,"tc" int,"systolic_blood_pressure_sbp" int,"parenteral_antibiotic_therapy" bool,"fasting_plasma_glucose_fpg" float,"active_infection" bool,"untreated_hyperlipidemia" bool,"hemoglobin_a1c_hba1c" float,"temperature" float,"diastolic_blood_pressure_dbp" int,"tgc" int,"causing_fever" boo... | SELECT * FROM table_dev_45 WHERE alcohol_abuse = 1 |
How many games were there in the 1966 season? | CREATE TABLE table_2352 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Boilermakers points" real,"Opponents" real,"Record" text) | SELECT MAX("Game") FROM table_2352 |
What catalog has a format of ED remaster CD and a date of December 19, 2001? | CREATE TABLE table_name_68 (catalog VARCHAR,format VARCHAR,date VARCHAR) | SELECT catalog FROM table_name_68 WHERE format = "ed remaster cd" AND date = "december 19, 2001" |
Find a certain deleted post 1257021. | CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number... | SELECT * FROM PostHistory WHERE PostId = 1257021 |
How many times did Boston Red Stockings lose in 2009 postseason? | CREATE TABLE postseason (team_id_loser VARCHAR,year VARCHAR)CREATE TABLE team (team_id_br VARCHAR,name VARCHAR) | SELECT COUNT(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2009 |
What is the lowest losses for a team that has 0 draws, fewer than 4 wins, and no Byes? | CREATE TABLE table_13554 ("Sunrayia FL" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real) | SELECT MIN("Losses") FROM table_13554 WHERE "Draws" = '0' AND "Wins" < '4' AND "Byes" < '0' |
What year was jack cole nominated? | CREATE TABLE table_name_77 (year VARCHAR,nominee VARCHAR) | SELECT year FROM table_name_77 WHERE nominee = "jack cole" |
How much time does it take for jean alesi and grids lesser than 5? | CREATE TABLE table_53348 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT "Time/Retired" FROM table_53348 WHERE "Grid" < '5' AND "Driver" = 'jean alesi' |
What group a winner was for nocerina? | CREATE TABLE table_16655 ("Season" text,"Group A Winner" text,"Group B Winner" text,"Group C Winner" text,"Group D Winner" text) | SELECT "Group A Winner" FROM table_16655 WHERE "Group D Winner" = 'Nocerina' |
What is the average number played that has fewer than 11 wins, more than 42 goals, more than 22 points, and 11 losses? | CREATE TABLE table_name_91 (played INTEGER,losses VARCHAR,points VARCHAR,wins VARCHAR,goals_for VARCHAR) | SELECT AVG(played) FROM table_name_91 WHERE wins < 11 AND goals_for > 42 AND points > 22 AND losses = 11 |
What away team plays at Arden Street Oval? | CREATE TABLE table_name_82 (away_team VARCHAR,venue VARCHAR) | SELECT away_team FROM table_name_82 WHERE venue = "arden street oval" |
Which church was organized by George M. Hinkle? | CREATE TABLE table_name_50 (church_name VARCHAR,organized_by VARCHAR) | SELECT church_name FROM table_name_50 WHERE organized_by = "george m. hinkle" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.