instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Posts that link to other sites. | CREATE TABLE PostTypes (Id number,Name 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 TABLE PostTags (PostId nu... | SELECT p.Id, p.PostTypeId, p.Score FROM Posts AS p WHERE p.Score > 1 AND p.PostTypeId = 1 AND p.Body LIKE '%judaism%' |
For those employees who was hired before 2002-06-21, give me the comparison about the average of employee_id over the hire_date bin hire_date by weekday by a bar chart. | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))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_DATE date,END_DATE date,JOB_ID varchar... | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' |
What is the Name with an Opened (closing date if defunct) of 1995 and has a Length of miles (m), in Illinois? | CREATE TABLE table_name_9 (name VARCHAR,state VARCHAR,opened__closing_date_if_defunct_ VARCHAR,length VARCHAR) | SELECT name FROM table_name_9 WHERE opened__closing_date_if_defunct_ = "1995" AND length = "miles (m)" AND state = "illinois" |
What are the names of the directors who made exactly one movie? | CREATE TABLE Movie (director VARCHAR) | SELECT director FROM Movie GROUP BY director HAVING COUNT(*) = 1 |
how many patients whose ethnicity is black/african american and days of hospital stay is greater than 1? | 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 WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.days_stay > "1" |
Mike Miller played for what school/club team? | CREATE TABLE table_40723 ("Player" text,"Nationality" text,"Position" text,"Years in Orlando" text,"School/Club Team" text) | SELECT "School/Club Team" FROM table_40723 WHERE "Player" = 'mike miller' |
What's the lowest round Justin Forsett was drafted in, with a draft pick larger than 233? | CREATE TABLE table_42182 ("Round" real,"Pick" real,"Name" text,"Position" text,"College" text) | SELECT MIN("Round") FROM table_42182 WHERE "Name" = 'justin forsett' AND "Pick" > '233' |
Which Nationality has a Round smaller than 3? | CREATE TABLE table_name_98 (nationality VARCHAR,round INTEGER) | SELECT nationality FROM table_name_98 WHERE round < 3 |
In the Spring-Summer term , what BIOSTAT courses are being taught ? | CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE ... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'BIOSTAT' AND semester.semester = 'Spring-Summer' |
how many patients had an urgent admission type with a sc drug route? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.route = "SC" |
What is the record for the date november 19? | CREATE TABLE table_29766 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Record" FROM table_29766 WHERE "Date" = 'November 19' |
what is smallest number in fleet for chassis manufacturer Scania and fleet numbers is 3230? | CREATE TABLE table_19197 ("Chassis Manufacturer" text,"Chassis Model" text,"Body Model" text,"Number in Fleet" real,"Fleet Numbers" text) | SELECT MIN("Number in Fleet") FROM table_19197 WHERE "Chassis Manufacturer" = 'Scania' AND "Fleet Numbers" = '3230' |
Name the reason for change pennsylvania 13th | CREATE TABLE table_73407 ("District" text,"Vacator" text,"Reason for change" text,"Successor" text,"Date successor seated" text) | SELECT "Reason for change" FROM table_73407 WHERE "District" = 'Pennsylvania 13th' |
What are the average price and score of wines for each appelation? | CREATE TABLE wine (no number,grape text,winery text,appelation text,state text,name text,year number,price number,score number,cases number,drink text)CREATE TABLE grapes (id number,grape text,color text)CREATE TABLE appellations (no number,appelation text,county text,state text,area text,isava text) | SELECT AVG(price), AVG(score), appelation FROM wine GROUP BY appelation |
Which Polish Context classes handle the PreMajor requirement ? | CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement varchar,enforced_requirement varchar,description varchar,num_semesters int,num_enrolled int,has_discussion varchar,has_lab varchar,has_projects varchar,has_exams varchar,num_reviews int,clarity_score i... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Polish Context%' OR course.description LIKE '%Polish Context%' OR course.name LIKE '%Polish Cont... |
Name the points against for porthcawl rfc | CREATE TABLE table_name_87 (points_against VARCHAR,club VARCHAR) | SELECT points_against FROM table_name_87 WHERE club = "porthcawl rfc" |
What is the lowest against when the draws are more than 0 and the losses are less than 3? | CREATE TABLE table_63531 ("Club" text,"Wins" real,"Losses" real,"Draws" real,"Against" real) | SELECT MIN("Against") FROM table_63531 WHERE "Losses" < '3' AND "Draws" > '0' |
how many patients got prescriptions for quinidine gluconate e.r. until 3 years ago? | CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE inputevents_cv (row_id number,subject_id num... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'quinidine gluconate e.r.' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 year')) |
What are the degrees conferred in 'San Francisco State University' in 2001. | CREATE TABLE degrees (Id VARCHAR)CREATE TABLE campuses (Id VARCHAR) | SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.Id = t2.campus WHERE t1.campus = "San Francisco State University" AND t2.year = 2001 |
avg passengers in 2012 for 2009 more than 104.5 and 2010 less than 162.6 and 2011 less than 141.8 is what? | CREATE TABLE table_5613 ("Rank" real,"Airline" text,"2012" real,"2011" real,"2010" real,"2009" real) | SELECT AVG("2012") FROM table_5613 WHERE "2009" > '104.5' AND "2010" < '162.6' AND "2011" < '141.8' |
when was the last time patient 022-130563 was prescribed medicine via inh route? | 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 lab (labid number,patientunitstayid number,labname text,labresult number,l... | 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 = '022-130563')) AND medication.routeadmin = 'inh' ORDER BY medic... |
flight from DALLAS to BOSTON tomorrow | 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 restriction (res... | 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 = 'BOSTON' AND date_day.day_number = 20 AND date_day.month_number = 1 AND da... |
How much Drawn has Goals Against of 81, and a Lost larger than 23? | CREATE TABLE table_79157 ("Position" real,"Team" text,"Played" real,"Drawn" real,"Lost" real,"Goals For" real,"Goals Against" real,"Goal Difference" text,"Points 1" text) | SELECT COUNT("Drawn") FROM table_79157 WHERE "Goals Against" = '81' AND "Lost" > '23' |
what is the cerclis ID when the site was proposed on 12/30/1982 and was partially deleted on 05/01/2003? | CREATE TABLE table_77866 ("CERCLIS ID" text,"Name" text,"County" text,"Proposed" text,"Listed" text,"Construction completed" text,"Partially deleted" text,"Deleted" text) | SELECT "CERCLIS ID" FROM table_77866 WHERE "Proposed" = '12/30/1982' AND "Partially deleted" = '05/01/2003' |
For each type, what is the average tonnage? | CREATE TABLE ship (ship_id number,name text,type text,nationality text,tonnage number)CREATE TABLE mission (mission_id number,ship_id number,code text,launched_year number,location text,speed_knots number,fate text) | SELECT type, AVG(tonnage) FROM ship GROUP BY type |
What is the Bello when Ben-Tahir is 296? | CREATE TABLE table_11447995_2 (bello VARCHAR,ben_tahir VARCHAR) | SELECT bello FROM table_11447995_2 WHERE ben_tahir = "296" |
what is date of birth and admission type of subject name james sloan? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t... | SELECT demographic.dob, demographic.admission_type FROM demographic WHERE demographic.name = "James Sloan" |
How many races in 2012 season have 0 podiums? | CREATE TABLE table_25980 ("Season" real,"Series" text,"Team" text,"Races" real,"Wins" real,"Poles" real,"F/Laps" real,"Podiums" real,"Points" text,"Position" text) | SELECT COUNT("Races") FROM table_25980 WHERE "Season" = '2012' AND "Podiums" = '0' |
What was the location for the date 7 10 october? | CREATE TABLE table_26686908_2 (city___state VARCHAR,date VARCHAR) | SELECT city___state FROM table_26686908_2 WHERE date = "7–10 October" |
list the patient identifications of patients who have been diagnosed with cannabis abuse-unspec since 2 years ago. | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_... | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_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 = 'cannabis abuse-unspec') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(... |
What is the 2005 value with a q2 in 2011, a q1 in 2012, and 1r in 2003? | CREATE TABLE table_name_48 (Id VARCHAR) | SELECT 2005 FROM table_name_48 WHERE 2011 = "q2" AND 2012 = "q1" AND 2003 = "1r" |
What are the companies and main industries of all companies that are not headquartered in the United States? | CREATE TABLE company (company_id number,rank number,company text,headquarters text,main_industry text,sales_billion number,profits_billion number,assets_billion number,market_value number)CREATE TABLE station_company (station_id number,company_id number,rank_of_the_year number)CREATE TABLE gas_station (station_id numbe... | SELECT company, main_industry FROM company WHERE headquarters <> 'USA' |
What was the name of the album that was a demo release? | CREATE TABLE table_47893 ("Year" real,"Album" text,"Release type" text,"Label" text,"Hungarian top 40 album charts" text) | SELECT "Album" FROM table_47893 WHERE "Release type" = 'demo' |
Find the last and first name of students who are playing Football or Lacrosse. | CREATE TABLE plays_games (stuid number,gameid number,hours_played number)CREATE TABLE sportsinfo (stuid number,sportname text,hoursperweek number,gamesplayed number,onscholarship text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE vid... | SELECT T2.lname, T2.fname FROM sportsinfo AS T1 JOIN student AS T2 ON T1.stuid = T2.stuid WHERE T1.sportname = "Football" OR T1.sportname = "Lacrosse" |
(Possibly) suspended users with Supporter badge. | 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 TABLE ReviewRejectionReasons (Id number,Name text,Description text,Po... | SELECT u.CreationDate, u.Id AS "user_link" FROM Users AS u INNER JOIN Badges AS b ON b.UserId = u.Id WHERE b.Name = 'Nice Question' AND u.Reputation <= 1 GROUP BY u.Id, u.CreationDate ORDER BY u.CreationDate |
Tell me the highest laps for time/retired of +2 laps and driver of felice bonetto | CREATE TABLE table_53369 ("Driver" text,"Constructor" text,"Laps" real,"Time/retired" text,"Grid" real) | SELECT MAX("Laps") FROM table_53369 WHERE "Time/retired" = '+2 laps' AND "Driver" = 'felice bonetto' |
What is the name for the species Authority of sigmodon hispidus say & ord, 1825? | CREATE TABLE table_67363 ("Name" text,"Species Authority" text,"Order" text,"Family" text,"Red List" real) | SELECT "Name" FROM table_67363 WHERE "Species Authority" = 'sigmodon hispidus say & ord, 1825' |
Which City has a Country of spain, and a Stadium of palacio de deportes de santander? | CREATE TABLE table_37255 ("Rank" real,"Stadium" text,"Capacity" real,"City" text,"Country" text) | SELECT "City" FROM table_37255 WHERE "Country" = 'spain' AND "Stadium" = 'palacio de deportes de santander' |
What was the office up for election when Sylvia Weinstein ran under the Socialist Workers ticket? | CREATE TABLE table_42003 ("Office" text,"Republican ticket" text,"Democratic ticket" text,"Liberal ticket" text,"Conservative ticket" text,"Socialist Workers ticket" text,"Socialist Labor ticket" text) | SELECT "Office" FROM table_42003 WHERE "Socialist Workers ticket" = 'sylvia weinstein' |
tell me the number of patients on main drug type prescription who were diagnosed with cardiac complications, not elsewhere classified. | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Surg compl-heart" AND prescriptions.drug_type = "MAIN" |
What date was parliament assembled when John rudhale was first member? | CREATE TABLE table_15451122_2 (assembled VARCHAR,first_member VARCHAR) | SELECT assembled FROM table_15451122_2 WHERE first_member = "John Rudhale" |
What kind of Altade a has del Pueblo of maroon/gray? | CREATE TABLE table_75760 ("Information" text,"Altade\u00f1a" text,"Aprende" text,"Centennial" text,"Kyrene MS" text,"del Pueblo" text) | SELECT "Altade\u00f1a" FROM table_75760 WHERE "del Pueblo" = 'maroon/gray' |
What is the time/retired of the one with grid of 16? | CREATE TABLE table_name_60 (time_retired VARCHAR,grid VARCHAR) | SELECT time_retired FROM table_name_60 WHERE grid = 16 |
Bar graph to show age from different name, display by the x-axis from high to low please. | CREATE TABLE driver (Driver_ID int,Name text,Party text,Home_city text,Age int)CREATE TABLE school_bus (School_ID int,Driver_ID int,Years_Working int,If_full_time bool)CREATE TABLE school (School_ID int,Grade text,School text,Location text,Type text) | SELECT Name, Age FROM driver ORDER BY Name DESC |
Which Score has a Series of flyers lead 3 2? | CREATE TABLE table_38138 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Series" text) | SELECT "Score" FROM table_38138 WHERE "Series" = 'flyers lead 3–2' |
How many settlements does each claim correspond to? List the claim id and the number of settlements. | CREATE TABLE customer_policies (policy_id number,customer_id number,policy_type_code text,start_date time,end_date time)CREATE TABLE claims (claim_id number,policy_id number,date_claim_made time,date_claim_settled time,amount_claimed number,amount_settled number)CREATE TABLE customers (customer_id number,customer_detai... | SELECT T1.claim_id, COUNT(*) FROM claims AS T1 JOIN settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id |
what's the price of quantitative g6pd. | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE admissions (row_id number,subje... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'quantitative g6pd')) |
What shows for 2002 when the 2004 is A, and the 2005 is 1r? | CREATE TABLE table_45219 ("Tournament" text,"2002" text,"2004" text,"2005" text,"2006" text) | SELECT "2002" FROM table_45219 WHERE "2004" = 'a' AND "2005" = '1r' |
Name the total number of represents for clary sermina delgado cid | CREATE TABLE table_73934 ("Represents" text,"Contestant" text,"Age" real,"Height (cm)" text,"Height (ft)" text,"Hometown" text) | SELECT COUNT("Represents") FROM table_73934 WHERE "Contestant" = 'Clary Sermina Delgado Cid' |
In Strategy of Sport Organizations what courses satisfy the PreMajor requirement ? | CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE program_course (program_id int,course_id int,workload int,categ... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Strategy of Sport Organizations%' OR course.description LIKE '%Strategy of Sport Organizations%'... |
Name the position for fis points being 3495 | CREATE TABLE table_30073089_2 (position VARCHAR,fis_points VARCHAR) | SELECT position FROM table_30073089_2 WHERE fis_points = 3495 |
What is sun yang's lowest rank? | CREATE TABLE table_name_20 (rank INTEGER,name VARCHAR) | SELECT MIN(rank) FROM table_name_20 WHERE name = "sun yang" |
Name the season for spvgg bayreuth and fsv salmrohr | CREATE TABLE table_969 ("Season" text,"Oberliga Bayern" text,"Oberliga Hessen" text,"Oberliga Baden-W\u00fcrttemberg" text,"Oberliga S\u00fcdwest" text) | SELECT "Season" FROM table_969 WHERE "Oberliga Bayern" = 'SpVgg Bayreuth' AND "Oberliga S\u00fcdwest" = 'FSV Salmrohr' |
How many songs have used the instrument 'drums'? | CREATE TABLE instruments (songid number,bandmateid number,instrument text)CREATE TABLE band (id number,firstname text,lastname text)CREATE TABLE tracklists (albumid number,position number,songid number)CREATE TABLE albums (aid number,title text,year number,label text,type text)CREATE TABLE vocals (songid number,bandmat... | SELECT COUNT(*) FROM instruments WHERE instrument = "drums" |
The 1.6 Duratec model/engine has how many torque formulas? | CREATE TABLE table_1212189_1 (torque__nm__rpm VARCHAR,model_engine VARCHAR) | SELECT COUNT(torque__nm__rpm) FROM table_1212189_1 WHERE model_engine = "1.6 Duratec" |
How much Preston North End has a Blackpool smaller than 0? | CREATE TABLE table_6320 ("Competition" text,"Played" real,"Blackpool" real,"Draw" real,"Preston North End" real) | SELECT COUNT("Preston North End") FROM table_6320 WHERE "Blackpool" < '0' |
What is the Lost with Against smaller than 25, and Played smaller than 1? | CREATE TABLE table_13005 ("Played" real,"Drawn" real,"Lost" real,"Against" real,"% Won" real) | SELECT AVG("Lost") FROM table_13005 WHERE "Against" < '25' AND "Played" < '1' |
On what Surface was the match against Malek Jaziri played? | CREATE TABLE table_50190 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Surface" FROM table_50190 WHERE "Opponent" = 'malek jaziri' |
Time ( ET ) of 1:00pm, and a Result of w 34 14 has what record? | CREATE TABLE table_name_67 (record VARCHAR,time___et__ VARCHAR,result VARCHAR) | SELECT record FROM table_name_67 WHERE time___et__ = "1:00pm" AND result = "w 34–14" |
What is the largest pick by the Baltimore Colts in a round later than 10? | CREATE TABLE table_name_27 (pick INTEGER,nfl_club VARCHAR,round VARCHAR) | SELECT MAX(pick) FROM table_name_27 WHERE nfl_club = "baltimore colts" AND round > 10 |
count the number of patients who were admitted via emergency hospital room and diagnosed with pneumonia in aspergillosis. | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.long_title = "Pneumonia in aspergillosis" |
Find posts with specific text. | CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE Post... | SELECT p.CreationDate AS "Date", u.Id AS "User ID", u.DisplayName AS "User Name", p.Id AS "post_link" FROM Posts AS p JOIN Users AS u ON u.Id = p.OwnerUserId WHERE p.Body LIKE '%##SpecifiedText##%' |
who is the the mens singles with mens doubles being kaj lindfors kaj osterberg | CREATE TABLE table_19031 ("Year" real,"Mens singles" text,"Womens singles" text,"Mens doubles" text,"Womens doubles" text,"Mixed doubles" text) | SELECT "Mens singles" FROM table_19031 WHERE "Mens doubles" = 'Kaj Lindfors Kaj Osterberg' |
ATLANTA to PITTSBURGH | CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flig... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSB... |
Which player has 68 as the score and canada as the country? | CREATE TABLE table_name_35 (player VARCHAR,score VARCHAR,country VARCHAR) | SELECT player FROM table_name_35 WHERE score = 68 AND country = "canada" |
How many players are affiliated with indiana university? | CREATE TABLE table_25518547_4 (player VARCHAR,affiliation VARCHAR) | SELECT COUNT(player) FROM table_25518547_4 WHERE affiliation = "Indiana University" |
For all storms with at least 1 death, show me the name and the total number of deaths with a bar chart, show Y-axis from high to low order. | CREATE TABLE region (Region_id int,Region_code text,Region_name text)CREATE TABLE affected_region (Region_id int,Storm_ID int,Number_city_affected real)CREATE TABLE storm (Storm_ID int,Name text,Dates_active text,Max_speed int,Damage_millions_USD real,Number_Deaths int) | SELECT Name, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Number_Deaths DESC |
how many spokesperson where in 2004 | CREATE TABLE table_2190 ("Year(s)" real,"Commentator" text,"Dual Commentator" text,"Spokesperson" text,"Channel" text) | SELECT COUNT("Spokesperson") FROM table_2190 WHERE "Year(s)" = '2004' |
Where did the home team score 18.17 (125)? | CREATE TABLE table_32816 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Venue" FROM table_32816 WHERE "Home team score" = '18.17 (125)' |
What is the sum of Points, when the Performer is fe-mail? | CREATE TABLE table_name_64 (points INTEGER,performer VARCHAR) | SELECT SUM(points) FROM table_name_64 WHERE performer = "fe-mail" |
In the match where fitzroy was the away team, where was the venue? | CREATE TABLE table_name_47 (venue VARCHAR,away_team VARCHAR) | SELECT venue FROM table_name_47 WHERE away_team = "fitzroy" |
What is the date of the U.S. Women's open? | CREATE TABLE table_name_61 (date VARCHAR,tournament VARCHAR) | SELECT date FROM table_name_61 WHERE tournament = "u.s. women's open" |
On what date was the format of ed remaster cd? | CREATE TABLE table_8573 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text) | SELECT "Date" FROM table_8573 WHERE "Format" = 'ed remaster cd' |
What team was the opponent on October 15, 1967? | CREATE TABLE table_name_66 (opponent VARCHAR,date VARCHAR) | SELECT opponent FROM table_name_66 WHERE date = "october 15, 1967" |
What is the largest amount of floors in the 70m (233ft) Tupper building (educational)? | CREATE TABLE table_name_11 (floors INTEGER,height VARCHAR,building VARCHAR) | SELECT MAX(floors) FROM table_name_11 WHERE height = "70m (233ft)" AND building = "tupper building (educational)" |
history of cardiac arrest. | CREATE TABLE table_train_72 ("id" int,"extracorporeal_membrane_oxygenation_ecmo_cannulation" bool,"heart_disease" bool,"meningitis_or_encephalitis" bool,"sepsis" bool,"cancer" bool,"prisoners" bool,"NOUSE" float) | SELECT * FROM table_train_72 WHERE prisoners = 1 |
which airliner attack on the list had the most dead ? | CREATE TABLE table_204_514 (id number,"date" text,"sub" number,"flight" text,"dead" number,"hurt" number,"pax." number,"type" text,"perpetrator" text,"description" text) | SELECT "flight" FROM table_204_514 ORDER BY "dead" DESC LIMIT 1 |
What was the total viewership for BBC One weekly rankings larger than 7, before episode 4? | CREATE TABLE table_name_30 (total_viewers VARCHAR,bbc_one_weekly_ranking VARCHAR,episode_no VARCHAR) | SELECT total_viewers FROM table_name_30 WHERE bbc_one_weekly_ranking > 7 AND episode_no < 4 |
What is the highest number of cuts made in a tournament with 0 wins and 0 top 5 placings? | CREATE TABLE table_14323 ("Tournament" text,"Wins" real,"Top-5" real,"Top-25" real,"Events" real,"Cuts made" real) | SELECT MAX("Cuts made") FROM table_14323 WHERE "Top-5" = '0' AND "Wins" < '0' |
What event of this season had a time of 2:43? | CREATE TABLE table_name_36 (event VARCHAR,time VARCHAR) | SELECT event FROM table_name_36 WHERE time = "2:43" |
Count of posts edited by two users. | CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat... | SELECT Week, '22', '17163', '17702', '13438' FROM (SELECT DATEADD(WEEK, DATEDIFF(WEEK, 0, CreationDate), 0) AS "week", c.UserId, COUNT(*) AS Count FROM Comments AS c WHERE c.UserId IN (22, 17163, 17702, 13438) AND YEAR(c.CreationDate) >= 2016 GROUP BY DATEADD(WEEK, DATEDIFF(WEEK, 0, CreationDate), 0), c.UserId) AS src ... |
What's the Total (kg) of a Snatch of 132.5? | CREATE TABLE table_name_86 (total__kg_ VARCHAR,snatch VARCHAR) | SELECT total__kg_ FROM table_name_86 WHERE snatch = 132.5 |
Which athlete performed before 1984 in an 800 m event? | CREATE TABLE table_51417 ("Year" real,"Event" text,"Record" text,"Athlete" text,"Nationality" text) | SELECT "Athlete" FROM table_51417 WHERE "Year" < '1984' AND "Event" = '800 m' |
Who was the opponent in Game 44? | CREATE TABLE table_46153 ("Game" text,"Date" text,"Opponent" text,"Score" text,"Location/Attendance" text,"Record" text) | SELECT "Opponent" FROM table_46153 WHERE "Game" = '44' |
How many silver when the team is northwest territories and gold is less than 34? | CREATE TABLE table_name_14 (silver VARCHAR,team VARCHAR,gold VARCHAR) | SELECT COUNT(silver) FROM table_name_14 WHERE team = "northwest territories" AND gold < 34 |
Who is the opponent when the score was 6 4, 6 2 and the surface was clay? | CREATE TABLE table_name_94 (opponent VARCHAR,score VARCHAR,surface VARCHAR) | SELECT opponent FROM table_name_94 WHERE score = "6–4, 6–2" AND surface = "clay" |
Can you tell me the Giant Slalom that has the Combined of 1, and the Country of united states, and the Victories larger than 11? | CREATE TABLE table_61339 ("Women" text,"Country" text,"Season" text,"Victories" real,"Downhill" text,"Super G" text,"Giant Slalom" text,"Slalom" text,"Combined" text) | SELECT "Giant Slalom" FROM table_61339 WHERE "Combined" = '1' AND "Country" = 'united states' AND "Victories" > '11' |
List the total points of gymnasts in descending order of floor exercise points. | CREATE TABLE people (people_id number,name text,age number,height number,hometown text)CREATE TABLE gymnast (gymnast_id number,floor_exercise_points number,pommel_horse_points number,rings_points number,vault_points number,parallel_bars_points number,horizontal_bar_points number,total_points number) | SELECT total_points FROM gymnast ORDER BY floor_exercise_points DESC |
What was the score of the game that home team birmingham city played? | CREATE TABLE table_60693 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Score" FROM table_60693 WHERE "Home team" = 'birmingham city' |
What is the comp when the ryds is 2? | CREATE TABLE table_40268 ("Year" text,"Team" text,"Comp" text,"Long" text,"Rate" text,"RAtt" text,"RYds" text,"RAvg" text,"Lost" text) | SELECT "Comp" FROM table_40268 WHERE "RYds" = '2' |
Show the number of races that had any driver whose forename is Lewis in each year with a line chart, sort in ascending by the x-axis. | CREATE TABLE races (raceId INTEGER,year INTEGER,round INTEGER,circuitId INTEGER,name TEXT,date TEXT,time TEXT,url TEXT)CREATE TABLE lapTimes (raceId INTEGER,driverId INTEGER,lap INTEGER,position INTEGER,time TEXT,milliseconds INTEGER)CREATE TABLE status (statusId INTEGER,status TEXT)CREATE TABLE driverStandings (driver... | SELECT year, COUNT(year) FROM results AS T1 JOIN races AS T2 ON T1.raceId = T2.raceId JOIN drivers AS T3 ON T1.driverId = T3.driverId WHERE T3.forename = "Lewis" GROUP BY year ORDER BY year |
Name the week 3 for team of mark/jennifer | CREATE TABLE table_75057 ("Team" text,"Week 1" text,"Week 2" text,"Week 3" text,"Week 4" text,"Week 5" text,"Week 6" text,"Week 7" text,"Week 8 Final" text) | SELECT "Week 3" FROM table_75057 WHERE "Team" = 'mark/jennifer' |
how many votes did both the conservative party and the rainbow dream ticket party receive ? | CREATE TABLE table_202_271 (id number,"party" text,"candidate" text,"votes" number,"%" number,"\u00b1%" number) | SELECT SUM("votes") FROM table_202_271 WHERE "party" IN ('conservative', 'rainbow dream ticket') |
Which courses in Advanced Portuguese satisfy the requirement for Core ? | 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 INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Advanced Portuguese%' OR course.description LIKE '%Advanced Portuguese%' OR course.name LIKE '%A... |
which boat was laid down on the same day as ha-202 ? | CREATE TABLE table_204_522 (id number,"boat #" text,"name" text,"builder" text,"laid down" text,"launched" text,"completed" text,"fate" text) | SELECT "name" FROM table_204_522 WHERE "name" <> 'ha-202' AND "laid down" = (SELECT "laid down" FROM table_204_522 WHERE "name" = 'ha-202') |
how many airco dh .4 's did the uk use in their period of service ? | CREATE TABLE table_204_161 (id number,"name" text,"1968 cf\ndesignator" text,"place of\nmanufacture" text,"primary\nrole(s)" text,"service\nperiod" text,"#\nused" number) | SELECT "#\nused" FROM table_204_161 WHERE "name" = 'airco dh.4' |
Name the total number for sub parish sokn for 1865 | CREATE TABLE table_1776 ("Parish (Prestegjeld)" text,"Sub-Parish (Sokn)" text,"Church Name" text,"Year Built" real,"Location of the Church" text) | SELECT COUNT("Sub-Parish (Sokn)") FROM table_1776 WHERE "Year Built" = '1865' |
What day was the opposing team Australia and the against 25? | CREATE TABLE table_name_77 (date VARCHAR,against VARCHAR,opposing_teams VARCHAR) | SELECT date FROM table_name_77 WHERE against = 25 AND opposing_teams = "australia" |
What was the record on Feb 25? | CREATE TABLE table_name_83 (record VARCHAR,date VARCHAR) | SELECT record FROM table_name_83 WHERE date = "feb 25" |
Who was the away team when Hawthorn was the home team? | CREATE TABLE table_33069 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team score" FROM table_33069 WHERE "Home team" = 'hawthorn' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.