instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
how many patients whose year of death is less than or equal to 2165 and item id is 51053? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2165.0" AND lab.itemid = "51053" |
What driver has under 53 laps, a grid smaller than 14, and a time/retired of differential? | CREATE TABLE table_name_28 (driver VARCHAR,time_retired VARCHAR,laps VARCHAR,grid VARCHAR) | SELECT driver FROM table_name_28 WHERE laps < 53 AND grid < 14 AND time_retired = "differential" |
alt < 60; ast < 60 | CREATE TABLE table_train_167 ("id" int,"alt" float,"body_weight" float,"ast" float,"hematocrit_hct" float,"thyroid_stimulating_hormone_stsh" int,"body_mass_index_bmi" float,"fasting_glucose" int,"NOUSE" float) | SELECT * FROM table_train_167 WHERE alt < 60 OR ast < 60 |
What is the highest number of losses for Presidente Hayes, when the draws were more than 4? | CREATE TABLE table_63814 ("Position" real,"Team" text,"Played" real,"Wins" real,"Draws" real,"Losses" real,"Scored" real,"Conceded" real,"Points" real) | SELECT MAX("Losses") FROM table_63814 WHERE "Team" = 'presidente hayes' AND "Draws" > '4' |
Return a histogram on what are the ids and names of the companies that operated more than one flight? | CREATE TABLE operate_company (id int,name text,Type text,Principal_activities text,Incorporated_in text,Group_Equity_Shareholding real)CREATE TABLE flight (id int,Vehicle_Flight_number text,Date text,Pilot text,Velocity real,Altitude real,airport_id int,company_id int)CREATE TABLE airport (id int,City text,Country text... | SELECT T1.name, T1.id FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id |
Top C# users in the netherlands. | CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId n... | SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS "#", Posts.OwnerUserId AS "user_link", COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 INNER JOIN Users ON Posts.OwnerUse... |
How many distinct locations of perpetrators are there? | CREATE TABLE people (people_id number,name text,height number,weight number,home town text)CREATE TABLE perpetrator (perpetrator_id number,people_id number,date text,year number,location text,country text,killed number,injured number) | SELECT COUNT(DISTINCT location) FROM perpetrator |
Name the tournament for may 18, 1997 | CREATE TABLE table_name_90 (tournament VARCHAR,date VARCHAR) | SELECT tournament FROM table_name_90 WHERE date = "may 18, 1997" |
Name the area for administrative county being flintshire | CREATE TABLE table_1130 ("Administrative county" text,"Area 1891 (Statute acres)" real,"Population 1891" real,"Area 1961 (Statute acres)" real,"Population 1961" real) | SELECT "Area 1891 (Statute acres)" FROM table_1130 WHERE "Administrative county" = 'Flintshire' |
how may patients below 83 years of age are diagnosed with personal history of malignant neoplasm of gastrointestinal tract, unspecified? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "83" AND diagnoses.long_title = "Personal history of malignant neoplasm of gastrointestinal tract, unspecified" |
Which Player is the shooting guard? | CREATE TABLE table_name_69 (player VARCHAR,position VARCHAR) | SELECT player FROM table_name_69 WHERE position = "shooting guard" |
What home team played at Lake Oval? | CREATE TABLE table_name_1 (home_team VARCHAR,venue VARCHAR) | SELECT home_team FROM table_name_1 WHERE venue = "lake oval" |
Posts by Day of Week since Jan. 2020. Number of posts by day of week, since Jan. 1, 2020 | CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE T... | SELECT TIME_TO_STR(CreationDate, '%A') AS dow, pt.Name, COUNT(*) AS cnt FROM Posts AS p INNER JOIN PostTypes AS pt ON p.PostTypeId = pt.Id WHERE CreationDate >= '2020-01-01T00:00:00' GROUP BY TIME_TO_STR(CreationDate, '%A'), Name ORDER BY Name, cnt |
how many actors have appeared in each musical?, order x-axis in ascending order please. | CREATE TABLE musical (Musical_ID int,Name text,Year int,Award text,Category text,Nominee text,Result text)CREATE TABLE actor (Actor_ID int,Name text,Musical_ID int,Character text,Duration text,age int) | SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID ORDER BY T2.Name |
Hidden gems: Lowest viewed questions with score 100 or higher. | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,Creati... | SELECT Posts.Id AS "post_link", Posts.OwnerUserId AS "user_link", Score, ViewCount, Score * 1000 / ViewCount AS "Score per Thousand Views" FROM Posts WHERE Score > 100 AND PostTypeId = 1 ORDER BY ViewCount LIMIT 1000 |
Get me the number of white russian patients who were admitted before 2152. | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.admityear < "2152" |
What is the season with a Skip of Eve Muirhead and a third of Kerry Barr? | CREATE TABLE table_name_42 (season VARCHAR,skip VARCHAR,third VARCHAR) | SELECT season FROM table_name_42 WHERE skip = "eve muirhead" AND third = "kerry barr" |
What was the original air date (atv) of episode 1? | CREATE TABLE table_19327 ("Episode no." real,"Title" text,"Director" text,"Writer(s)" text,"Original Air Date (ATV)" text,"Production no." real) | SELECT "Original Air Date (ATV)" FROM table_19327 WHERE "Episode no." = '1' |
What was the Venue in 1986 with an Outcome of 1? | CREATE TABLE table_name_71 (venue VARCHAR,year VARCHAR,outcome VARCHAR) | SELECT venue FROM table_name_71 WHERE year = "1986" AND outcome = "1" |
What is the lowest number of points of any team with less than 6 draws and less than 18 matches played? | CREATE TABLE table_77949 ("Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Diff" real) | SELECT MIN("Points") FROM table_77949 WHERE "Drawn" < '6' AND "Played" < '18' |
Which Award has a Result of nominated, and a Year of 2003? | CREATE TABLE table_name_85 (award VARCHAR,result VARCHAR,year VARCHAR) | SELECT award FROM table_name_85 WHERE result = "nominated" AND year = 2003 |
In what region does 17.4% of the population make below 50% of the median income? | CREATE TABLE table_25042332_16 (region VARCHAR,below_50_percentage_of_median_income VARCHAR) | SELECT region FROM table_25042332_16 WHERE below_50_percentage_of_median_income = "17.4%" |
What was the greatest number of laps run? | CREATE TABLE table_3945 ("Finish" real,"Start" real,"Car" real,"Driver" text,"Make" text,"Sponsor" text,"Pts/bns" text,"Laps" real,"Status" text,"Winnings" real) | SELECT MAX("Laps") FROM table_3945 |
calculate the total number of patients with icd9 code 3782 on medicare insurance | 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.insurance = "Medicare" AND procedures.icd9_code = "3782" |
Which country has a place smaller than 8 and points smaller than 5? | CREATE TABLE table_name_63 (country VARCHAR,place VARCHAR,points VARCHAR) | SELECT country FROM table_name_63 WHERE place < 8 AND points < 5 |
Which cell type has a conduction speed of 35? | CREATE TABLE table_41594 ("Animal" text,"Cell type" text,"Resting potential (mV)" text,"AP increase (mV)" text,"AP duration (ms)" text,"Conduction speed (m/s)" text) | SELECT "Cell type" FROM table_41594 WHERE "Conduction speed (m/s)" = '35' |
Number of questions with 'please' in the title.. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoR... | SELECT COUNT(*), COUNT(ClosedDate), AVG(Score) FROM Posts WHERE PostTypeId = 1 AND TIME_TO_STR(CreationDate, '%Y') = 2012 AND (PATINDEX('%please%', LOWER(Title)) > 0 OR PATINDEX('%pls%', LOWER(Title)) > 0 OR PATINDEX('%plz%', LOWER(Title)) > 0) |
Show different parties of people along with the number of people in each party Plot them as bar chart, rank y-axis from low to high order. | CREATE TABLE debate_people (Debate_ID int,Affirmative int,Negative int,If_Affirmative_Win bool)CREATE TABLE debate (Debate_ID int,Date text,Venue text,Num_of_Audience int)CREATE TABLE people (People_ID int,District text,Name text,Party text,Age int) | SELECT Party, COUNT(*) FROM people GROUP BY Party ORDER BY COUNT(*) |
what's the number of households with per capita income being $16,820 | CREATE TABLE table_18766 ("Rank" real,"Place" text,"County" text,"Per Capita Income" text,"Median House- hold Income" text,"Population" real,"Number of Households" real) | SELECT "Number of Households" FROM table_18766 WHERE "Per Capita Income" = '$16,820' |
what portion of the Middle East is Hindu? | CREATE TABLE table_899 ("Region" text,"Total Population" real,"Hindus" real,"% of Hindus" text,"% of Hindu total" text) | SELECT "% of Hindus" FROM table_899 WHERE "Region" = 'Middle East' |
Show white percentages of cities and the crime rates of counties they are in. | CREATE TABLE city (White VARCHAR,County_ID VARCHAR)CREATE TABLE county_public_safety (Crime_rate VARCHAR,County_ID VARCHAR) | SELECT T1.White, T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID |
how many clubs were runner ups after the year 2000 ? | CREATE TABLE table_203_125 (id number,"club" text,"winners" number,"runner-ups" number,"winning years" text,"runner-up years" text) | SELECT COUNT("club") FROM table_203_125 WHERE "runner-up years" > 2000 |
When did episode number 6 air? | CREATE TABLE table_26811 ("Episode no." real,"Airdate" text,"Viewers" real,"BBC Three weekly ranking" real,"Cable rank" real) | SELECT "Airdate" FROM table_26811 WHERE "Episode no." = '6' |
how many patients underwent a packed cell transfusion two times since 2104? | 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 patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_items (row_id number,i... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'packed cell transfusi... |
count the number of patients who are below the age of 76 and their drug code is imdu30. | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "76" AND prescriptions.formulary_drug_cd = "IMDU30" |
What is the total of overall values with a safety position in a round greater than 1? | CREATE TABLE table_33393 ("Round" real,"Overall" real,"Player" text,"Position" text,"College" text) | SELECT COUNT("Overall") FROM table_33393 WHERE "Position" = 'safety' AND "Round" > '1' |
What years does the school have that's in Makikihi? | CREATE TABLE table_name_23 (years VARCHAR,area VARCHAR) | SELECT years FROM table_name_23 WHERE area = "makikihi" |
Where was the friendly competition on 7 June 1999 played? | CREATE TABLE table_77818 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Venue" FROM table_77818 WHERE "Competition" = 'friendly' AND "Date" = '7 june 1999' |
Which players college is Tennessee? | CREATE TABLE table_1083 ("Pick #" real,"NFL Team" text,"Player" text,"Position" text,"College" text) | SELECT "Player" FROM table_1083 WHERE "College" = 'Tennessee' |
what was the medication that patient 50286 was prescribed for the last time through the im route in 11/last year? | CREATE TABLE diagnoses_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 microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)C... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 50286) AND prescriptions.route = 'im' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', pres... |
What is the men's nickname at the school that has the lady wildcats women's nickname? | CREATE TABLE table_10577579_3 (men’s_nickname VARCHAR,women’s_nickname VARCHAR) | SELECT men’s_nickname FROM table_10577579_3 WHERE women’s_nickname = "Lady Wildcats" |
What is the total number of positions with less than 10 points, more than 7 qualifying, ret value in Race 1, and Jonathan Grant driving? | CREATE TABLE table_name_51 (pos VARCHAR,driver VARCHAR,race_1 VARCHAR,points VARCHAR,qualifying VARCHAR) | SELECT COUNT(pos) FROM table_name_51 WHERE points < 10 AND qualifying > 7 AND race_1 = "ret" AND driver = "jonathan grant" |
What is the lowest total when arabs is 4000? | CREATE TABLE table_28194 ("Metropolitan ring" text,"Localities" real,"Total" real,"Jews and others 1" real,"Thereof: Jews" real,"Arabs" real,"Population density (per km\u00b2)" text,"Annual Population growth rate" text) | SELECT MIN("Total") FROM table_28194 WHERE "Arabs" = '4000' |
calculate the minimum age of patients admitted on or after 2156 who stayed in hospital for 29 days. | 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 MIN(demographic.age) FROM demographic WHERE demographic.days_stay = "29" AND demographic.admityear >= "2156" |
Where was the game played that had a score of 3-2 and a time of 15:00 cet? | CREATE TABLE table_69244 ("Date" text,"Time" text,"Round" text,"Opponent" text,"Ground" text,"Score" text) | SELECT "Ground" FROM table_69244 WHERE "Score" = '3-2' AND "Time" = '15:00 cet' |
how many competitors were from the same country as david moller ? | CREATE TABLE table_204_862 (id number,"rank" number,"bib" number,"athlete" text,"country" text,"run 1" text,"run 2" text,"total" text,"behind" number) | SELECT COUNT("athlete") FROM table_204_862 WHERE "athlete" <> 'david moller' AND "country" = (SELECT "country" FROM table_204_862 WHERE "athlete" = 'david moller') |
What is the highest position for less than 42 played? | CREATE TABLE table_name_48 (position INTEGER,played INTEGER) | SELECT MAX(position) FROM table_name_48 WHERE played < 42 |
what are the three most frequent prescribed drugs for patients that were prescribed with imipenem-cilastatin at the same time the previous year? | CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type te... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'imipenem-cilastatin' AND DATETIME(prescriptions.startdate, 'start... |
get me the number of elective hospital admission patients who have drug code abac300. | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.formulary_drug_cd = "ABAC300" |
how many papers has jeff dean published ? | CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE field (fieldid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE ... | SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'jeff dean' AND writes.authorid = author.authorid |
Which number has a 0.35 percentage? | CREATE TABLE table_name_26 (number VARCHAR,percentage___percentage_ VARCHAR) | SELECT number FROM table_name_26 WHERE percentage___percentage_ = "0.35" |
what were the hospital hospital admission times of patient 006-157753 this year? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE cost (costid number,uniquepid text,patientheal... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '006-157753' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') |
Show the number of date account opened from each date account opened, and rank by the y-axis in asc. | CREATE TABLE Orders (order_id INTEGER,customer_id INTEGER,date_order_placed DATETIME,order_details VARCHAR(255))CREATE TABLE Invoices (invoice_number INTEGER,order_id INTEGER,invoice_date DATETIME)CREATE TABLE Invoice_Line_Items (order_item_id INTEGER,invoice_number INTEGER,product_id INTEGER,product_title VARCHAR(80),... | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts ORDER BY COUNT(date_account_opened) |
Name the week when the result was l 38-17 | CREATE TABLE table_10601 ("Week" text,"Date" text,"Opponent" text,"Result" text,"Kickoff [a ]" text,"Game site" text,"Attendance" text,"Record" text) | SELECT "Week" FROM table_10601 WHERE "Result" = 'l 38-17' |
what were the three most frequent drugs prescribed for patients who were also prescribed with chlorhexidine gluconate at the same time in 2105? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_va... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'chlorhexidine gluconate' AND STRFTIME('%y', prescriptions.startda... |
during the current hospital visit what was the first ward id of patient 94229? | 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 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,inti... | SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94229 AND admissions.dischtime IS NULL) AND NOT transfers.wardid IS NULL ORDER BY transfers.intime LIMIT 1 |
What are the won games with losing bonus of 0? | CREATE TABLE table_18962 ("Club" text,"Played" text,"Won" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text) | SELECT "Won" FROM table_18962 WHERE "Losing bonus" = '0' |
how many patients whose admission type is newborn and item id is 51274? | 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.admission_type = "NEWBORN" AND lab.itemid = "51274" |
Name the segment d for chicken | CREATE TABLE table_15187735_3 (segment_d VARCHAR,segment_c VARCHAR) | SELECT segment_d FROM table_15187735_3 WHERE segment_c = "Chicken" |
What was the HT for the game at Stadio Luigi Ferraris? | CREATE TABLE table_71076 ("DATE" text,"SCORE" text,"H.T." text,"VENUE" text,"COMPETITION" text) | SELECT "H.T." FROM table_71076 WHERE "VENUE" = 'stadio luigi ferraris' |
Show me about the distribution of All_Home and the sum of Team_ID , and group by attribute All_Home in a bar chart, order by the y axis in asc. | 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 All_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY SUM(Team_ID) |
Which Time has a Round larger than 1, and an Event of total fighting alliance 2? | CREATE TABLE table_name_21 (time VARCHAR,round VARCHAR,event VARCHAR) | SELECT time FROM table_name_21 WHERE round > 1 AND event = "total fighting alliance 2" |
who was the previous winner before john henry phelan in 1951 ? | CREATE TABLE table_203_509 (id number,"year" number,"laetare medalist" text,"position" text) | SELECT "laetare medalist" FROM table_203_509 WHERE "year" < 1951 ORDER BY "year" DESC LIMIT 1 |
What was the final score when River Plate was the runner-up? | CREATE TABLE table_24772 ("Season" text,"Champion" text,"Runner-Up" text,"Result" text,"League MVP" text,"Finals MVP" text,"Winning Coach" text) | SELECT "Result" FROM table_24772 WHERE "Runner-Up" = 'River Plate' |
Who was the director of the episode with series number 116? | CREATE TABLE table_28212888_2 (directed_by VARCHAR,no_in_series VARCHAR) | SELECT directed_by FROM table_28212888_2 WHERE no_in_series = 116 |
Users with at least X total badges. | CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Comments (Id number,PostId number,Score number,Text te... | SELECT UserId AS "user_link", COUNT(*) AS badgeCount FROM Badges GROUP BY UserId HAVING COUNT(*) > 100 ORDER BY badgeCount DESC |
What is the average field goal someone has when they have 0 extra points but more than 5 touch downs? | CREATE TABLE table_name_80 (field_goals INTEGER,extra_points VARCHAR,touchdowns VARCHAR) | SELECT AVG(field_goals) FROM table_name_80 WHERE extra_points > 0 AND touchdowns > 5 |
Most answers in a tag. | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId num... | SELECT u.Id AS "user_link", COUNT(p.Id) AS Answers FROM Users AS u, Posts AS p INNER JOIN Posts AS q ON p.ParentId = q.Id WHERE p.PostTypeId = 2 AND u.Id = p.OwnerUserId AND q.Tags LIKE '%##tag##%' GROUP BY u.Id ORDER BY COUNT(p.Id) DESC LIMIT 100 |
What is the branding for the radio with a frequency of 1150 am? | CREATE TABLE table_63071 ("Frequency" text,"Call sign" text,"Branding" text,"Format" text,"Owner" text) | SELECT "Branding" FROM table_63071 WHERE "Frequency" = '1150 am' |
Name the application for caligari corporation | CREATE TABLE table_23038 ("Application" text,"Latest release date and version" text,"Developed by" text,"Platforms" text,"Mainly Used For" text,"License" text) | SELECT "Application" FROM table_23038 WHERE "Developed by" = 'Caligari Corporation' |
How many averages for the province with evening gown score of 8.00 | CREATE TABLE table_15081939_4 (average VARCHAR,evening_gown VARCHAR) | SELECT COUNT(average) FROM table_15081939_4 WHERE evening_gown = "8.00" |
In which year(s) did the person who has a total of 291 win? | CREATE TABLE table_name_69 (year_s__won VARCHAR,total VARCHAR) | SELECT year_s__won FROM table_name_69 WHERE total = 291 |
What school is in Jeromesville? | CREATE TABLE table_24935743_2 (location VARCHAR,school VARCHAR) | SELECT location FROM table_24935743_2 WHERE school = "Jeromesville" |
What is the release price for a processor with part number cy80632007227ab? | CREATE TABLE table_16729930_18 (release_price___usd__ VARCHAR,part_number_s_ VARCHAR) | SELECT release_price___usd__ FROM table_16729930_18 WHERE part_number_s_ = "CY80632007227AB" |
What sport happened at Wildcat Stadium? | CREATE TABLE table_36873 ("Club" text,"Sport" text,"League" text,"Venue" text,"Established" real,"Championships" real) | SELECT "Sport" FROM table_36873 WHERE "Venue" = 'wildcat stadium' |
SELECT * FROM (SELECT * FROM Users WHERE Views = 10). | CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PostFeedback (Id number,PostId ... | SELECT * FROM Users WHERE Views = 10 AND Reputation > 1000 LIMIT 1 |
provide the number of patients whose days of hospital stay is greater than 8 and drug route is id? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "8" AND prescriptions.route = "ID" |
Which country has a $46,426 median family income? | CREATE TABLE table_5143 ("County" text,"Per capita income" text,"Median household income" text,"Median family income" text,"Population" real,"Number of households" real) | SELECT "County" FROM table_5143 WHERE "Median family income" = '$46,426' |
Which General classification has a Stage of 7? | CREATE TABLE table_name_95 (general_classification VARCHAR,stage VARCHAR) | SELECT general_classification FROM table_name_95 WHERE stage = "7" |
What was the date of the game against the New York Jets? | CREATE TABLE table_name_7 (date VARCHAR,opponent VARCHAR) | SELECT date FROM table_name_7 WHERE opponent = "new york jets" |
on which date was the game played with the most number of people in attendance ? | CREATE TABLE table_204_441 (id number,"date" text,"opponent" text,"venue" text,"result" text,"attendance" number,"scorers" text) | SELECT "date" FROM table_204_441 ORDER BY "attendance" DESC LIMIT 1 |
Where is the cunningham hill infant school located? | CREATE TABLE table_28523_2 (location VARCHAR,school VARCHAR) | SELECT location FROM table_28523_2 WHERE school = "Cunningham Hill Infant school" |
Out of total number of patients having aortic valve insuffiency.aortic valve replacement /sda as their primary disease, how many of them had a closed bronchial biopsy? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" AND procedures.short_title = "Closed bronchial biopsy" |
What is the total for the player with a Finish of T39? | CREATE TABLE table_12441 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text) | SELECT "Total" FROM table_12441 WHERE "Finish" = 't39' |
How many areas are named West Isles? | CREATE TABLE table_1600 ("Official Name" text,"Status" text,"Area km 2" text,"Population" real,"Census Ranking" text) | SELECT COUNT("Area km 2") FROM table_1600 WHERE "Official Name" = 'West Isles' |
What is Score, when Date is 10 July 2011? | CREATE TABLE table_name_65 (score VARCHAR,date VARCHAR) | SELECT score FROM table_name_65 WHERE date = "10 july 2011" |
What engine with more than 2 points has Brabham bt58 as Chassis? | CREATE TABLE table_67506 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real) | SELECT "Engine" FROM table_67506 WHERE "Chassis" = 'brabham bt58' AND "Points" > '2' |
What is the total number of interview scores that have an evening gown score of 9.543 and an average that is bigger than 9.521? | CREATE TABLE table_name_59 (interview INTEGER,evening_gown VARCHAR,average VARCHAR) | SELECT SUM(interview) FROM table_name_59 WHERE evening_gown = 9.543 AND average > 9.521 |
Which production code had original air dated february20,2011 | CREATE TABLE table_26259391_1 (production_code VARCHAR,original_air_date VARCHAR) | SELECT production_code FROM table_26259391_1 WHERE original_air_date = "February20,2011" |
WHAT IS THE WINNER WITH ATCC ROUND 6? | CREATE TABLE table_48233 ("Date" text,"Series" text,"Circuit" text,"City / State" text,"Winner" text,"Team" text) | SELECT "Winner" FROM table_48233 WHERE "Series" = 'atcc round 6' |
What transfer window has bra as the country, with 3.4m as the transfer fee? | CREATE TABLE table_name_79 (transfer_window VARCHAR,country VARCHAR,transfer_fee VARCHAR) | SELECT transfer_window FROM table_name_79 WHERE country = "bra" AND transfer_fee = "£3.4m" |
Average length of answer bodies.. | 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 SUM(LENGTH(Body)) AS "total_chars" FROM Posts WHERE PostTypeId = 2 AND OwnerUserId = '##userId##' |
Best Users from Sri Lanka. | CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE ReviewTas... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%lanka%' OR UPPER(Location) LIKE '%SRI' ORDER BY Reputation DESC LIMIT 200 |
What is theoriginal air date of the episode directed by timothy van patten? | CREATE TABLE table_17272 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Musical guest and song" text,"Original air date" text,"Production code" text) | SELECT "Original air date" FROM table_17272 WHERE "Directed by" = 'Timothy Van Patten' |
What is the lowest Top-25 that has 3 Events and Wins greater than 0? | CREATE TABLE table_name_94 (top_25 INTEGER,events VARCHAR,wins VARCHAR) | SELECT MIN(top_25) FROM table_name_94 WHERE events = 3 AND wins > 0 |
What is the sum of the total for a routine score of 26.6? | CREATE TABLE table_name_69 (total INTEGER,routine_score VARCHAR) | SELECT SUM(total) FROM table_name_69 WHERE routine_score = 26.6 |
Give me a bar chart for the total number of each class | CREATE TABLE race (Race_ID int,Name text,Class text,Date text,Track_ID text)CREATE TABLE track (Track_ID int,Name text,Location text,Seating real,Year_Opened real) | SELECT Class, COUNT(*) FROM race GROUP BY Class |
Which driver retired from a collision after 41 laps? | CREATE TABLE table_11190 ("Driver" text,"Constructor" text,"Laps" text,"Time/Retired" text,"Grid" text) | SELECT "Driver" FROM table_11190 WHERE "Time/Retired" = 'collision' AND "Laps" = '41' |
How many seasons are there with Formula Holden? | CREATE TABLE table_30419 ("Series" text,"Seasons" real,"Races" real,"Poles" real,"Wins" real,"Podiums (Non-win)" real,"Point Finishes (Non-podium)" real,"Teams" real,"Total Points" real,"Championships" real,"Best Finish (Championship)" text) | SELECT COUNT("Seasons") FROM table_30419 WHERE "Series" = 'Formula Holden' |
What is Opponent, when Championship is P tange? | CREATE TABLE table_name_69 (opponent VARCHAR,championship VARCHAR) | SELECT opponent FROM table_name_69 WHERE championship = "pétange" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.