instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
did vietnam or south korea had the more silver medals ? | CREATE TABLE table_204_248 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "nation" FROM table_204_248 WHERE "nation" IN ('vietnam', 'south korea') ORDER BY "silver" DESC LIMIT 1 |
questions + views for tags on serverfault. Enter Query Description | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,Crea... | SELECT Tags.TagName, COUNT(Posts.Id) AS questions, SUM(ViewCount) AS views FROM Posts LEFT JOIN PostTags ON Posts.Id = PostTags.PostId LEFT JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName IN ('asterisk', 'pbx', 'sms', 'voip') GROUP BY Tags.TagName |
For all storms with at least 1 death, compare the number of deaths by name with a bar graph, order from low to high by the Y-axis. | CREATE TABLE storm (Storm_ID int,Name text,Dates_active text,Max_speed int,Damage_millions_USD real,Number_Deaths int)CREATE TABLE affected_region (Region_id int,Storm_ID int,Number_city_affected real)CREATE TABLE region (Region_id int,Region_code text,Region_name text) | SELECT Name, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Number_Deaths |
Which Venue has an amount of Tickets Sold/ Available of 4,700 / 4,700 (100%)? | CREATE TABLE table_name_21 (venue VARCHAR,tickets_sold___available VARCHAR) | SELECT venue FROM table_name_21 WHERE tickets_sold___available = "4,700 / 4,700 (100%)" |
As far as upper-level COMP classes are concerned , what classes are offered in the Summer ? | CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE course_p... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'COMP' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Summer... |
how many patients whose discharge location is short term hospital and age is less than 70? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.age < "70" |
FIRST class round trip airfare from INDIANAPOLIS to MEMPHIS | 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_elapsed int,to_airport varchar)CREATE TABLE flight_stop (fli... | 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, fare_basis, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'INDIANAPOLIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_co... |
How many albums are there? | CREATE TABLE album (albumid number,title text,artistid number)CREATE TABLE artist (artistid number,name text)CREATE TABLE employee (employeeid number,lastname text,firstname text,title text,reportsto number,birthdate time,hiredate time,address text,city text,state text,country text,postalcode text,phone text,fax text,e... | SELECT COUNT(*) FROM album |
how many 50 ml flex cont : magnesium sulfate 4% ij soln prescriptions have been written during the previous year? | 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 treatment (treatmentid number,patientunitstayid number,treatmentname... | SELECT COUNT(*) FROM medication WHERE medication.drugname = '50 ml flex cont : magnesium sulfate 4% ij soln' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') |
What is the completion percentage when yards per attempt was done by Steve McNair : 2003? | CREATE TABLE table_23054 ("Rank" text,"Rating" text,"Completion Percentage" text,"Touchdown Percentage" text,"Yards Per Attempt" text,"Total Yards" text) | SELECT "Completion Percentage" FROM table_23054 WHERE "Yards Per Attempt" = 'Steve McNair : 2003' |
how much was patient 27656's difference of arterial bp [diastolic] last measured on the first icu visit compared to the value second to last measured on the first icu visit? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status t... | 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 = 27656) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item... |
What is the result of the ceremony in 2006 (79th)? | CREATE TABLE table_name_1 (result VARCHAR,year__ceremony_ VARCHAR) | SELECT result FROM table_name_1 WHERE year__ceremony_ = "2006 (79th)" |
Find ACC_Road and School_ID , and group by attribute All_Home, and visualize them by a bar chart, order by the Y from high to low. | CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY School_ID DESC |
What is the 2007 estimate when the rank (csa) is 4 | CREATE TABLE table_544 ("Rank (CSA)" text,"Combined Statistical Area (or Metropolitan Statistical Area if noted)" text,"State(s)" text,"2007 Estimate" text,"2000 Population" text,"Percent Change (1990\u20132000)" text) | SELECT "2007 Estimate" FROM table_544 WHERE "Rank (CSA)" = '4' |
Name the total number for co 2 for atd/axr | CREATE TABLE table_22011 ("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 COUNT("CO 2") FROM table_22011 WHERE "Engine ID code(s)" = 'ATD/AXR' |
Who was Albino Buticchi's constructor? | CREATE TABLE table_name_53 (constructor VARCHAR,driver VARCHAR) | SELECT constructor FROM table_name_53 WHERE driver = "albino buticchi" |
If the Rank is 10, what was the time on Sat aug 28? | CREATE TABLE table_29180 ("Rank" real,"Rider" text,"Sat 21 Aug" text,"Mon 23 Aug" text,"Tues 24 Aug" text,"Wed 25 Aug" text,"Thurs 26 Aug" text,"Fri 27 Aug" text,"Sat 28 Aug" text) | SELECT "Sat 28 Aug" FROM table_29180 WHERE "Rank" = '10' |
Which title has the Translation of vesoul? | CREATE TABLE table_54795 ("Track" real,"Title" text,"Translation" text,"Composer" text,"Recorded" text) | SELECT "Title" FROM table_54795 WHERE "Translation" = 'vesoul' |
Which To par has a Year(s) won of 1964? | CREATE TABLE table_13145 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text) | SELECT "To par" FROM table_13145 WHERE "Year(s) won" = '1964' |
when was the last time that patient 006-172277 was prescribed a medication via the im route in this hospital encounter? | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventt... | SELECT 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 = '006-172277' AND patient.hospitaldischargetime IS NULL)) AND me... |
What is the lengths behind of Jeremy Rose? | CREATE TABLE table_name_73 (lengths_behind VARCHAR,jockey VARCHAR) | SELECT lengths_behind FROM table_name_73 WHERE jockey = "jeremy rose" |
What year was the Spanish Grand Prix where Emerson Fittipaldi drove? | CREATE TABLE table_name_30 (year VARCHAR,event VARCHAR,driver VARCHAR) | SELECT year FROM table_name_30 WHERE event = "spanish grand prix" AND driver = "emerson fittipaldi" |
How many League Cup Goals have Total Apps of 36, and Total Goals smaller than 1? | CREATE TABLE table_13793 ("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,"Total Apps" text,"Total Goals" real) | SELECT COUNT("League Cup Goals") FROM table_13793 WHERE "Total Apps" = '36' AND "Total Goals" < '1' |
Which workshop groups have bookings with status code 'stop'? Give me the names, and count them by a bar chart, and show in descending by the x axis please. | CREATE TABLE Performers_in_Bookings (Order_ID INTEGER,Performer_ID INTEGER)CREATE TABLE Customers (Customer_ID VARCHAR(100),Address_ID INTEGER,Customer_Name VARCHAR(255),Customer_Phone VARCHAR(255),Customer_Email_Address VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Invoice_Items (Invoice_Item_ID INTEGER,Invoice... | SELECT Store_Name, COUNT(Store_Name) FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" GROUP BY Store_Name ORDER BY Store_Name DESC |
What is the smallest pick with a Reg GP less than 0? | CREATE TABLE table_53376 ("Rd #" real,"Pick #" real,"Player" text,"Team (League)" text,"Reg GP" real) | SELECT MIN("Pick #") FROM table_53376 WHERE "Reg GP" < '0' |
What season did SV Darmstadt 98 end up at RL S d (1st)? | CREATE TABLE table_73190 ("Season" text,"RL S\u00fcd (1st)" text,"RL S\u00fcd (2nd)" text,"RL S\u00fcdwest (1st)" text,"RL S\u00fcdwest (2nd)" text) | SELECT "Season" FROM table_73190 WHERE "RL S\u00fcd (1st)" = 'SV Darmstadt 98' |
Which player made exactly 223 passes? | CREATE TABLE table_28461589_2 (player VARCHAR,passes VARCHAR) | SELECT player FROM table_28461589_2 WHERE passes = 223 |
how many patients stayed in hospital for more than 15 days and lab tested with urea nitrogen? | 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 procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "15" AND lab.label = "Urea Nitrogen" |
What date has 136-134 as the score? | CREATE TABLE table_38118 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Record" text) | SELECT "Date" FROM table_38118 WHERE "Score" = '136-134' |
who else was on the paper with Ameet Soni and Ras Bodik ? | CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE venue (venueid int,venuename varchar)CREATE... | SELECT DISTINCT WRITES_2.authorid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1, writes AS WRITES_2 WHERE AUTHOR_0.authorname = 'Ameet Soni' AND AUTHOR_1.authorname = 'Ras Bodik' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperi... |
What is the Score of the game with a Loss of Kiprusoff (2 2)? | CREATE TABLE table_14114 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Series" text,"Arena" text) | SELECT "Score" FROM table_14114 WHERE "Loss" = 'kiprusoff (2–2)' |
What day was the surface clay and the score 6 1, 6 4? | CREATE TABLE table_name_23 (date VARCHAR,surface VARCHAR,score VARCHAR) | SELECT date FROM table_name_23 WHERE surface = "clay" AND score = "6–1, 6–4" |
was the fluticasone-salmeterol 250-50 mcg/dose in aepb prescribed to patient 035-2205 on their current hospital encounter? | 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 COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-2205' AND patient.hospitaldischargetime IS NULL)) AND medication.drugn... |
All Git-related tags (no GUIs, hosting services, etc.). | 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 * FROM Tags WHERE TagName LIKE 'git%' AND NOT TagName LIKE 'github%' AND NOT TagName LIKE 'gitlab%' AND TagName NOT IN ('git-bash', 'gitblit', 'gitbook', 'gitbox', 'gitbucket', 'giter8', 'gitg', 'gitk', 'gitkit', 'gitkraken', 'gitlist', 'gitnub', 'gitolite', 'gitorious', 'gitosis', 'gitpitch', 'gitpython', 'gits... |
how many tracks does the album have ? | CREATE TABLE table_204_932 (id number,"#" number,"title" text,"time" text,"lead vocals" text,"notes" text) | SELECT COUNT(*) FROM table_204_932 |
What was the date when the opponent was at South carolina? | CREATE TABLE table_7068 ("Date" text,"Opponent" text,"Location" text,"Result" text,"Attendance" real) | SELECT "Date" FROM table_7068 WHERE "Opponent" = 'at south carolina' |
How many joined the Warriors? | CREATE TABLE table_262508_1 (joined VARCHAR,nickname VARCHAR) | SELECT COUNT(joined) FROM table_262508_1 WHERE nickname = "Warriors" |
What was the competition on October 21, 2003? | CREATE TABLE table_33895 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Competition" FROM table_33895 WHERE "Date" = 'october 21, 2003' |
provide the number of patients whose admission location is emergency room admit and lab test name is hemoglobin? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND lab.label = "Hemoglobin" |
give me the number of spanish speaking patients who were born before the year 2197. | 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 WHERE demographic.language = "SPAN" AND demographic.dob_year < "2197" |
when did patient 83062 get a prescription first time, this month? | 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 procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE labevents (row_id number... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83062) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY prescriptions.startdate LIMIT 1 |
What is the lowest round of the pick #8 player with an overall greater than 72 from the college of temple? | CREATE TABLE table_38695 ("Round" real,"Pick #" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT MIN("Round") FROM table_38695 WHERE "Pick #" = '8' AND "College" = 'temple' AND "Overall" > '72' |
on 8 30 please schedule me on a flight from DENVER to SAN FRANCISCO early in the morning | CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE flight_s... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 30 AND date_day.month_number = ... |
What Goals with a Level of 5 or greater is the lowest? | CREATE TABLE table_name_95 (goals INTEGER,level INTEGER) | SELECT MIN(goals) FROM table_name_95 WHERE level > 5 |
Which Player has a Pick larger than 2, and a Position of forward? | CREATE TABLE table_8856 ("Pick" real,"Player" text,"Position" text,"Nationality" text,"Former Team" text) | SELECT "Player" FROM table_8856 WHERE "Pick" > '2' AND "Position" = 'forward' |
What are the names of projects that require between 100 and 300 hours? | CREATE TABLE assignedto (scientist number,project text)CREATE TABLE projects (code text,name text,hours number)CREATE TABLE scientists (ssn number,name text) | SELECT name FROM projects WHERE hours BETWEEN 100 AND 300 |
what is the average weight of jamarr sanders and robert williams ? | CREATE TABLE table_204_534 (id number,"#" number,"name" text,"height" text,"weight (lbs.)" number,"position" text,"class" text,"hometown" text,"previous team(s)" text) | SELECT AVG("weight (lbs.)") FROM table_204_534 WHERE "name" IN ('jamarr sanders', 'robert williams') |
What June 10-11 is is that corresponds to March 28, 1968? | CREATE TABLE table_27522 ("June 10-11" text,"March 27-29" text,"January 15-16" text,"November 3" text,"August 21-22" text) | SELECT "June 10-11" FROM table_27522 WHERE "March 27-29" = 'March 28, 1968' |
Where was 2010 tournament where the United States received the silver? | CREATE TABLE table_33306 ("Year" real,"Gold" text,"Silver" text,"Bronze" text,"Venue" text) | SELECT "Venue" FROM table_33306 WHERE "Silver" = 'united states' AND "Year" = '2010' |
What's the Length with the Version of Album Version? | CREATE TABLE table_name_60 (length VARCHAR,version VARCHAR) | SELECT length FROM table_name_60 WHERE version = "album version" |
Find the addresses and author IDs of the course authors that teach at least two courses. | CREATE TABLE course_authors_and_tutors (author_id number,author_tutor_atb text,login_name text,password text,personal_name text,middle_name text,family_name text,gender_mf text,address_line_1 text)CREATE TABLE subjects (subject_id number,subject_name text)CREATE TABLE courses (course_id number,author_id number,subject_... | SELECT T1.address_line_1, T2.author_id FROM course_authors_and_tutors AS T1 JOIN courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id HAVING COUNT(*) >= 2 |
name the note that appears last on the minor seventh column of the table . | CREATE TABLE table_203_324 (id number,"chord" text,"root" text,"major third" text,"perfect fifth" text,"minor seventh" text) | SELECT "minor seventh" FROM table_203_324 ORDER BY id DESC LIMIT 1 |
Which public college has a nickname of The Grenadiers? | CREATE TABLE table_name_30 (institution VARCHAR,type VARCHAR,nickname VARCHAR) | SELECT institution FROM table_name_30 WHERE type = "public" AND nickname = "grenadiers" |
What are the details for statements with the details 'Private Project', and what are the names of the corresponding documents? | CREATE TABLE documents (document_id number,document_type_code text,project_id number,document_date time,document_name text,document_description text,other_details text)CREATE TABLE ref_document_types (document_type_code text,document_type_name text,document_type_description text)CREATE TABLE ref_budget_codes (budget_ty... | SELECT T1.statement_details, T2.document_name FROM statements AS T1 JOIN documents AS T2 ON T1.statement_id = T2.document_id WHERE T1.statement_details = 'Private Project' |
Name the artist of 2 draw | CREATE TABLE table_14977252_2 (artist VARCHAR,draw VARCHAR) | SELECT artist FROM table_14977252_2 WHERE draw = 2 |
In which round is pick number 242? | CREATE TABLE table_name_92 (round VARCHAR,pick VARCHAR) | SELECT COUNT(round) FROM table_name_92 WHERE pick = "242" |
what is the pick when the overall is less than 297 and the college is alabama? | CREATE TABLE table_name_16 (pick VARCHAR,overall VARCHAR,college VARCHAR) | SELECT pick FROM table_name_16 WHERE overall < 297 AND college = "alabama" |
when did patient 92788 get a immunology (cmv) microbiology test last time in 12/this year? | CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,i... | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92788) AND microbiologyevents.spec_type_desc = 'immunology (cmv)' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME()... |
count the number of patients who have white ethnic background with a diagnosis icd9 code v4502. | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.icd9_code = "V4502" |
find the number of patients who are below the age of 41 and lab test category is blood gas. | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" AND lab."CATEGORY" = "Blood Gas" |
What conference is the 1973-74 team in the Atlantic Division (Div.)? | CREATE TABLE table_6852 ("Season" text,"Team" text,"Conference (Conf.)" text,"Division (Div.)" text,"Win%" text,"Awards" text) | SELECT "Conference (Conf.)" FROM table_6852 WHERE "Division (Div.)" = 'atlantic' AND "Team" = '1973-74' |
Opponents of sebasti n decoud santiago giraldo had what surface? | CREATE TABLE table_name_71 (surface VARCHAR,opponents VARCHAR) | SELECT surface FROM table_name_71 WHERE opponents = "sebastián decoud santiago giraldo" |
H-index (based on answer scores) ranking per tag. | CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId n... | SELECT MIN(H.NumAnswersCumul) AS HIndex, MIN(B.Class) AS TagBadge FROM (SELECT S.OwnerUserId, S.Score, SUM(S.NumAnswers) OVER (PARTITION BY S.OwnerUserId ORDER BY S.Score DESC rows BETWEEN unbounded preceding AND CURRENT ROW) AS NumAnswersCumul FROM (SELECT P.OwnerUserId, P.Score, COUNT(*) AS NumAnswers FROM Posts AS P... |
What is the result F_A on 17 December 2002? | CREATE TABLE table_name_60 (result_f_a VARCHAR,date VARCHAR) | SELECT result_f_a FROM table_name_60 WHERE date = "17 december 2002" |
How many dates had an average speed of 102.003? | CREATE TABLE table_2175858_1 (date VARCHAR,average_speed__mph_ VARCHAR) | SELECT COUNT(date) FROM table_2175858_1 WHERE average_speed__mph_ = "102.003" |
Give me the trend about the number of church opening in each year. | CREATE TABLE wedding (Church_ID int,Male_ID int,Female_ID int,Year int)CREATE TABLE people (People_ID int,Name text,Country text,Is_Male text,Age int)CREATE TABLE church (Church_ID int,Name text,Organized_by text,Open_Date int,Continuation_of text) | SELECT Open_Date, COUNT(Open_Date) FROM church GROUP BY Open_Date |
What place is player johnny miller, who has a to par of +2? | CREATE TABLE table_name_28 (place VARCHAR,to_par VARCHAR,player VARCHAR) | SELECT place FROM table_name_28 WHERE to_par = "+2" AND player = "johnny miller" |
Name the condition for partial thromboplastin time of prolonged and platelet count of unaffected with bleeding time of prolonged | CREATE TABLE table_70995 ("Condition" text,"Prothrombin time" text,"Partial thromboplastin time" text,"Bleeding time" text,"Platelet count" text) | SELECT "Condition" FROM table_70995 WHERE "Partial thromboplastin time" = 'prolonged' AND "Platelet count" = 'unaffected' AND "Bleeding time" = 'prolonged' |
What is the first name of the faculty members who participated in at least one activity? For each of them, also show the number of activities they participated in with a bar chart, and sort in descending by the Y-axis. | CREATE TABLE Activity (actid INTEGER,activity_name varchar(25))CREATE TABLE Participates_in (stuid INTEGER,actid INTEGER)CREATE TABLE Faculty (FacID INTEGER,Lname VARCHAR(15),Fname VARCHAR(15),Rank VARCHAR(15),Sex VARCHAR(1),Phone INTEGER,Room VARCHAR(5),Building VARCHAR(13))CREATE TABLE Student (StuID INTEGER,LName VA... | SELECT Fname, COUNT(*) FROM Faculty AS T1 JOIN Faculty_Participates_in AS T2 ON T1.FacID = T2.FacID GROUP BY T1.FacID ORDER BY COUNT(*) DESC |
What is the lowest amount of losses when the goldne rivers is quambatook, wins are smaller than 15 and draws larger than 0? | CREATE TABLE table_60462 ("Golden Rivers" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real) | SELECT MIN("Losses") FROM table_60462 WHERE "Wins" < '15' AND "Golden Rivers" = 'quambatook' AND "Draws" > '0' |
Name the course for team time trial | CREATE TABLE table_name_58 (course VARCHAR,type VARCHAR) | SELECT course FROM table_name_58 WHERE type = "team time trial" |
For all players, show the number of different club names they come from, and rank by the bars from low to high. | CREATE TABLE competition (Competition_ID int,Year real,Competition_type text,Country text)CREATE TABLE club (Club_ID int,name text,Region text,Start_year text)CREATE TABLE player (Player_ID int,name text,Position text,Club_ID int,Apps real,Tries real,Goals text,Points real)CREATE TABLE competition_result (Competition_I... | SELECT T1.name, COUNT(T1.name) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID GROUP BY T1.name ORDER BY T1.name |
What is Fitzroy's Home team score? | CREATE TABLE table_77751 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team score" FROM table_77751 WHERE "Home team" = 'fitzroy' |
so what's the average bicarbonate value of patient 006-207754 until 17 months ago? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,disch... | SELECT AVG(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 = '006-207754')) AND lab.labname = 'bicarbonate' AND DATETIME(lab.labresulttime) <= D... |
what livery has a status of in service as coaching stock? | CREATE TABLE table_name_74 (livery VARCHAR,status VARCHAR) | SELECT livery FROM table_name_74 WHERE status = "in service as coaching stock" |
How many schools get higher revenue via Child Nutrition A than revenue via child left school behind act? | CREATE TABLE finrev_fed_key_17 (state_code number,state text,#_records text)CREATE TABLE finrev_fed_17 (state_code number,idcensus number,school_district text,nces_id text,yr_data number,t_fed_rev number,c14 number,c25 number)CREATE TABLE ndecoreexcel_math_grade8 (year number,state text,all_students text,average_scale_... | SELECT COUNT(*) FROM finrev_fed_17 WHERE c25 > c14 |
What camera has the highest Mpix with an aspect ratio of 2:1, a height less than 1536, and a width smaller than 2048? | CREATE TABLE table_name_51 (mpix INTEGER,width VARCHAR,aspect_ratio VARCHAR,height VARCHAR) | SELECT MAX(mpix) FROM table_name_51 WHERE aspect_ratio = "2:1" AND height < 1536 AND width < 2048 |
what is the number of tracks under one minute in length ? | CREATE TABLE table_203_37 (id number,"#" number,"title" text,"producer(s)" text,"performer(s)" text,"length" text) | SELECT COUNT("title") FROM table_203_37 WHERE "length" < 1 |
What is the total of wins when the cuts made is 76 and the events greater than 115? | CREATE TABLE table_76030 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real) | SELECT SUM("Wins") FROM table_76030 WHERE "Cuts made" = '76' AND "Events" > '115' |
What score when more than 20,562 attended with record at 45 36? | CREATE TABLE table_10219 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Attendance" real,"Record" text) | SELECT "Score" FROM table_10219 WHERE "Attendance" > '20,562' AND "Record" = '45–36' |
what is the place when the score is 70-70=140? | CREATE TABLE table_45452 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Place" FROM table_45452 WHERE "Score" = '70-70=140' |
what was the last time patient 3911 got the rapid respiratory viral antigen test microbiology test on the first hospital visit? | CREATE TABLE procedures_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_labitems (row_id number,itemid number,labe... | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3911 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND microbiologyevents.spec_type_desc = 'rapid respiratory viral antig... |
tell me the number of self pay insurance patients who had angioplasty of other non-coronary vessel(s). | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Self Pay" AND procedures.long_title = "Angioplasty of other non-coronary vessel(s)" |
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of first_name and commission_pct , and list in descending by the bar please. | 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 countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DA... | SELECT FIRST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME DESC |
For next semester , what upper-level electives are offered that do n't meet on Monday or Friday ? | CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course... |
How many head coaches are there for the website, http://www.burleighbulldogs.org/? | CREATE TABLE table_11365528_2 (head_coach VARCHAR,website VARCHAR) | SELECT COUNT(head_coach) FROM table_11365528_2 WHERE website = "http://www.burleighbulldogs.org/" |
What is the date of successors formal installation when the reason for change is resigned december 4, 1819? | CREATE TABLE table_225099_3 (date_of_successors_formal_installation VARCHAR,reason_for_change VARCHAR) | SELECT date_of_successors_formal_installation FROM table_225099_3 WHERE reason_for_change = "Resigned December 4, 1819" |
Which date had a loser of New York Giants and a result of 23-17? | CREATE TABLE table_name_77 (date VARCHAR,loser VARCHAR,result VARCHAR) | SELECT date FROM table_name_77 WHERE loser = "new york giants" AND result = "23-17" |
Who had the high points on January 23? | CREATE TABLE table_17298 ("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_17298 WHERE "Date" = 'January 23' |
Which athlete is from Norway? | CREATE TABLE table_79375 ("Rank" real,"Athlete" text,"Country" text,"Time" text,"Notes" text) | SELECT "Athlete" FROM table_79375 WHERE "Country" = 'norway' |
What is the date for the home team score of 6.5 (41)? | CREATE TABLE table_37518 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Ground" text,"Crowd" real,"Date" text,"Report" text) | SELECT "Date" FROM table_37518 WHERE "Home team score" = '6.5 (41)' |
How many Years have a % 'B' Aggregates of 28%, and an Average A's per learner smaller than 3.2800000000000002? | CREATE TABLE table_7271 ("Year" real,"Pass Rate" text,"% 'A' Aggregates" text,"% 'B' Aggregates" text,"% 'A' or 'B' Aggregates" text,"Average A's per learner" real) | SELECT COUNT("Year") FROM table_7271 WHERE "% 'B' Aggregates" = '28%' AND "Average A's per learner" < '3.2800000000000002' |
How many people attended the game at the miami orange bowl? | CREATE TABLE table_name_49 (attendance INTEGER,game_site VARCHAR) | SELECT SUM(attendance) FROM table_name_49 WHERE game_site = "miami orange bowl" |
Which tournament's 2001 and 2008 were a when 2010 was qf? | CREATE TABLE table_37946 ("Tournament" text,"1998" text,"1999" text,"2000" text,"2001" text,"2002" text,"2003" text,"2004" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text) | SELECT "Tournament" FROM table_37946 WHERE "2001" = 'a' AND "2008" = 'a' AND "2010" = 'qf' |
what is the total intake (ml)-ng/og tube nasogastric left mouth amount that patient 035-166 received? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitsta... | SELECT 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 = '035-166')) AND intakeoutput.celllabel = 'intake ... |
Get all suggested edits on a specific post. | 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 rt.PostId AS "post_link", 'site://review/suggested-edits/' + CAST(rt.Id AS TEXT) + '|review' AS review, CASE WHEN se.ApprovalDate IS NULL THEN 'Rejected' ELSE 'Approved' END AS "status", 'site://users/' + CAST(u.Id AS TEXT) + '|' + u.DisplayName AS "suggested_by", COALESCE(se.ApprovalDate, se.RejectionDate) AS "... |
Name the El samurai with MAZADA of x for Ryuji Hijikata of draw (30:00) | CREATE TABLE table_57983 ("Block A" text,"Ryuji Hijikata" text,"Shuji Kondo" text,"MAZADA" text,"El Samurai" text) | SELECT "El Samurai" FROM table_57983 WHERE "MAZADA" = 'x' AND "Ryuji Hijikata" = 'draw (30:00)' |
Who had the highest rebounds in the game where the record was 27-54? | CREATE TABLE table_2788 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "High rebounds" FROM table_2788 WHERE "Record" = '27-54' |
provide the number of patients whose diagnosis short title is skin disorders nec and lab test fluid is joint fluid. | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita... | 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 = "Skin disorders NEC" AND lab.fluid = "Joint Fluid" |
Show me the minimal weight by sex in a bar, sort the x in asc order. | CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real)CREATE TABLE candidate (Candidate_ID int,People_ID int,Poll_Source text,Date text,Support_rate real,Consider_rate real,Oppose_rate real,Unsure_rate real) | SELECT Sex, MIN(Weight) FROM people GROUP BY Sex ORDER BY Sex |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.