instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
what is the company with the parent company wrightbus? | CREATE TABLE table_250309_1 (company VARCHAR,parent_company VARCHAR) | SELECT company FROM table_250309_1 WHERE parent_company = "Wrightbus" |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, a bar chart shows the distribution of hire_date and the average of employee_id bin hire_date by time. | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE employees (... | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 |
Is it okay if I take 792 on Mondays and Wednesdays ? | CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predi... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour... |
where is the pegah team located? | CREATE TABLE table_name_74 (city VARCHAR,team VARCHAR) | SELECT city FROM table_name_74 WHERE team = "pegah" |
how many patients whose year of birth is less than 1879 and item id is 51093? | 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 procedures (subject_id text,hadm_id te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "1879" AND lab.itemid = "51093" |
What is the total number of 1st prize ($) that has a United States country with a score lower than 271 and in a year after 1964 with a winner of Bobby Mitchell? | CREATE TABLE table_71110 ("Year" real,"Winner" text,"Country" text,"Score" real,"To par" text,"1st prize ($)" real) | SELECT COUNT("1st prize ( $ )") FROM table_71110 WHERE "Country" = 'united states' AND "Score" < '271' AND "Year" > '1964' AND "Winner" = 'bobby mitchell' |
What was the date for XLLP 369? | CREATE TABLE table_name_12 (date VARCHAR,catalog VARCHAR) | SELECT date FROM table_name_12 WHERE catalog = "xllp 369" |
What game number did the Wildcats play Purdue? | CREATE TABLE table_20850527_1 (game VARCHAR,opponent VARCHAR) | SELECT game FROM table_20850527_1 WHERE opponent = "Purdue" |
Count of posts with only one tag, grouped by tag. | 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 CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE FlagTypes (Id number,Name text,Description text)C... | SELECT COUNT(p.Id), p.Tags FROM Posts AS p WHERE NOT p.Tags LIKE '%><%' GROUP BY p.Tags ORDER BY COUNT(p.Id) DESC |
What is the current version of windows 8 with an RTM build of 9200? | CREATE TABLE table_32474 ("Name" text,"Release date" text,"RTM build" text,"Current version" text,"Status support" text,"License" text,"Based on (kernel)" text,"Supported architectures" text,"OS type" text) | SELECT "Current version" FROM table_32474 WHERE "RTM build" = '9200' AND "Name" = 'windows 8' |
this year, what are the top three most frequent diagnoses that patients were diagnosed with in the same month after the diagnosis of brain hem nec-brief coma. | CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)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 chartevents (row_id n... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions... |
Getting top 50 viewed posts. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE CloseAsOffTopicReasonTy... | SELECT * FROM Posts ORDER BY ViewCount DESC LIMIT 50 |
what is the difference in weight between the re 465 and the ae 6/6 ? | CREATE TABLE table_204_850 (id number,"name" text,"railway" text,"series" text,"maker" text,"dates" text,"drive" text,"wheel arrangement" text,"weight" text,"power" text,"notes" text) | SELECT ABS((SELECT "weight" FROM table_204_850 WHERE "name" = 're 465') - (SELECT "weight" FROM table_204_850 WHERE "name" = 'ae 6/6')) |
How many million U.S. viewers watched the episode with a production code of 1arc03? | CREATE TABLE table_27980 ("No. in series" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text) | SELECT "U.S. viewers (million)" FROM table_27980 WHERE "Production code" = '1ARC03' |
what is the division north when division south was ko uf and division southwest was ilinden velmej | CREATE TABLE table_17881033_1 (division_north VARCHAR,division_south VARCHAR,division_southwest VARCHAR) | SELECT division_north FROM table_17881033_1 WHERE division_south = "Kožuf" AND division_southwest = "Ilinden Velmej" |
Which routes have 'replaced by US 81' listed in their remarks section? | CREATE TABLE table_11336756_6 (route_name VARCHAR,remarks VARCHAR) | SELECT route_name FROM table_11336756_6 WHERE remarks = "Replaced by US 81" |
What is the lowest capacity with an opening larger than 2015 in Trabzon? | CREATE TABLE table_52024 ("Stadium" text,"Capacity" real,"City" text,"Club" text,"Opening" real) | SELECT MIN("Capacity") FROM table_52024 WHERE "Opening" > '2015' AND "City" = 'trabzon' |
What is the HDI 2011 of the country with a DI 2011 of 7.63? | CREATE TABLE table_33326 ("Country" text,"Area (km\u00b2) 2010" text,"Population 2011" text,"GDP (PPP) (Intl. $) 2011" text,"GDP (PPP) per capita (Intl. $) 2011" text,"Income inequality 1994\u20132011 (latest available)" text,"HDI 2011" text,"FSI 2012" text,"CPI 2011" text,"IEF 2011" text,"GPI 2012" text,"WPFI 2011/201... | SELECT "HDI 2011" FROM table_33326 WHERE "DI 2011" = '7.63' |
Which Winner has a Country of norway, and a FIS Nordic World Ski Championships of 1924? | CREATE TABLE table_45907 ("Winner" text,"Country" text,"Winter Olympics" text,"FIS Nordic World Ski Championships" text,"Holmenkollen" text) | SELECT "Winner" FROM table_45907 WHERE "Country" = 'norway' AND "FIS Nordic World Ski Championships" = '1924' |
What was the time of the car having a constructor of Renault, which went 40 laps? | CREATE TABLE table_38800 ("Driver" text,"Constructor" text,"Laps" text,"Time/Retired" text,"Grid" text) | SELECT "Time/Retired" FROM table_38800 WHERE "Constructor" = 'renault' AND "Laps" = '40' |
had a absolute lymphocyte count lab test patient 51675 received until 3 years ago? | CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,l... | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'absolute lymphocyte count') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51675) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME... |
what is the region when the location is 49.7462 n 117.1419 w? | CREATE TABLE table_name_96 (region VARCHAR,location VARCHAR) | SELECT region FROM table_name_96 WHERE location = "49.7462°n 117.1419°w" |
When the shares were less than 8, how many total viewers were there? | CREATE TABLE table_name_12 (total_viewers VARCHAR,share INTEGER) | SELECT total_viewers FROM table_name_12 WHERE share < 8 |
Show all review task states. | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,... | SELECT * FROM ReviewTaskStates |
Name the fourth district for joan runnels | CREATE TABLE table_15442974_1 (fourth_district VARCHAR,second_district VARCHAR) | SELECT fourth_district FROM table_15442974_1 WHERE second_district = "Joan Runnels" |
how many patients stayed in hospital for more than 0 days and used the drug Morphine sulfate sr? | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "0" AND prescriptions.drug = "Morphine Sulfate SR" |
What is Robert Dirk's team? | CREATE TABLE table_2850912_3 (college_junior_club_team VARCHAR,player VARCHAR) | SELECT college_junior_club_team FROM table_2850912_3 WHERE player = "Robert Dirk" |
What theme placed as #3 in the finale? | CREATE TABLE table_452 ("Episode" text,"Theme" text,"Song choice" text,"Original artist" text,"Order #" text,"Result" text) | SELECT "Result" FROM table_452 WHERE "Theme" = 'Finale' AND "Order #" = '3' |
What was the Illinois Derby purse? | CREATE TABLE table_10481 ("Date" text,"Track" text,"Race" text,"Dist." text,"Purse (US$)" text,"Track Surf." text,"Winning horse" text,"Win jockey" text) | SELECT "Purse ( US$ )" FROM table_10481 WHERE "Race" = 'illinois derby' |
Can you tell me the Year(s) Won that has the To par larger than 5, and the Total smaller than 155, and the Country of united states? | CREATE TABLE table_name_18 (year_s__won VARCHAR,country VARCHAR,to_par VARCHAR,total VARCHAR) | SELECT year_s__won FROM table_name_18 WHERE to_par > 5 AND total < 155 AND country = "united states" |
Who are the most knowledgable users for a given tag?. | 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 Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE Comment... | SELECT U.Id AS "user_link", SUM(A.Score) AS ASum, AVG(A.Score) AS AAvg, VAR(A.Score) AS AVar FROM Posts AS Q JOIN PostTags AS PT ON PT.PostId = Q.Id JOIN Tags AS T ON T.Id = PT.TagId JOIN Posts AS A ON A.ParentId = Q.Id JOIN Users AS U ON U.Id = A.OwnerUserId WHERE T.TagName = '##Tag##' GROUP BY U.Id |
Name the ryusuke taguchi for Jushin Liger of liger (9:57) | CREATE TABLE table_10108 ("Block A" text,"Wataru Inoue" text,"Jushin Liger" text,"Minoru" text,"Ryusuke Taguchi" text,"Tatsuhito Takaiwa" text,"Yujiro" text) | SELECT "Ryusuke Taguchi" FROM table_10108 WHERE "Jushin Liger" = 'liger (9:57)' |
where births is 388 000 how many number is natural increase | CREATE TABLE table_2429 ("Period" text,"Births" text,"Deaths" text,"Difference" text,"Crude Birth Rate" real,"Crude Death Rate" real,"Natural Increase" real,"Total Fertility Rate" real,"Infant Mortality Rate" real) | SELECT COUNT("Natural Increase") FROM table_2429 WHERE "Births" = '388 000' |
Get users that have contributed to a keyword.. | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate tim... | SELECT p.Title, p.Tags, p.CreationDate, p.AnswerCount, p.CommentCount, p.OwnerUserId, Users.DisplayName, Users.Reputation FROM Posts AS p JOIN Users ON Users.Id = p.OwnerUserId WHERE p.Tags LIKE '%qt%' ORDER BY p.CreationDate |
For those employees who was hired before 2002-06-21, give me the comparison about the amount of job_id over the job_id , and group by attribute job_id, and order by the total number in ascending. | CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JO... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) |
Which Tie no that has an Away team of altrincham? | CREATE TABLE table_name_28 (tie_no VARCHAR,away_team VARCHAR) | SELECT tie_no FROM table_name_28 WHERE away_team = "altrincham" |
What is the total number of weeks that the Giants played against the Dallas Cowboys? | CREATE TABLE table_48181 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Channel" text,"Attendance" text) | SELECT COUNT("Week") FROM table_48181 WHERE "Opponent" = 'dallas cowboys' |
Which country has its most recent year as being 2005 and has an Adult Men literacy rate of 96%? | CREATE TABLE table_74670 ("Country" text,"Year (most recent)" real,"Adult (15+) Literacy Rate Total" text,"Adult Men" text,"Adult Women" text,"Youth (15-24) Literacy Rate Total" text,"Youth Men" text,"Youth Women" text) | SELECT "Country" FROM table_74670 WHERE "Year (most recent)" = '2005' AND "Adult Men" = '96%' |
Which Score has a Date of 13 april 1997? | CREATE TABLE table_name_50 (score VARCHAR,date VARCHAR) | SELECT score FROM table_name_50 WHERE date = "13 april 1997" |
Who are the hosts from the event with a theme of codehunters and the host city of Bangkok? | CREATE TABLE table_38862 ("Year" text,"Theme" text,"Host city" text,"Venue" text,"Hosts" text) | SELECT "Hosts" FROM table_38862 WHERE "Host city" = 'bangkok' AND "Theme" = 'codehunters' |
what are the three commonly ordered drugs for patients who were diagnosed with hyperglycemia previously within the same hospital visit, this year? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature ... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyperglycemia' ... |
Name the released for pat mills | CREATE TABLE table_1620397_2 (released VARCHAR,author VARCHAR) | SELECT released FROM table_1620397_2 WHERE author = "Pat Mills" |
What is the proportion of carriers of phones? | CREATE TABLE phone_market (Market_ID int,Phone_ID text,Num_of_stock int)CREATE TABLE phone (Name text,Phone_ID int,Memory_in_G int,Carrier text,Price real)CREATE TABLE market (Market_ID int,District text,Num_of_employees int,Num_of_shops real,Ranking int) | SELECT Carrier, COUNT(Carrier) FROM phone GROUP BY Carrier |
When the country was Scotland, how many ends were won? | CREATE TABLE table_72835 ("Country" text,"Skip" text,"W" real,"L" real,"PF" real,"PA" real,"Ends Won" real,"Ends Lost" real,"Blank Ends" real,"Stolen Ends" real,"Shot %" real) | SELECT COUNT("Ends Won") FROM table_72835 WHERE "Country" = 'Scotland' |
How many kills when percentage is more than 0.313, attempts are more than 1035 and assists are larger than 57? | CREATE TABLE table_name_32 (kills VARCHAR,assists VARCHAR,percentage VARCHAR,total_attempts VARCHAR) | SELECT COUNT(kills) FROM table_name_32 WHERE percentage > 0.313 AND total_attempts > 1035 AND assists > 57 |
how many of the patients on self pay had coronary athrscl natve vessel? | 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.insurance = "Self Pay" AND diagnoses.short_title = "Crnry athrscl natve vssl" |
How many points did the Club score that has a try bonus of 7 and 52 tries for ? | CREATE TABLE table_71633 ("Club" text,"Played" 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 "Points for" FROM table_71633 WHERE "Tries for" = '52' AND "Try bonus" = '7' |
Who were the Men's doubles of the years that had Krist na Lud kov as Women's singles after the year 2008? | CREATE TABLE table_42087 ("Year" real,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text) | SELECT "Men's doubles" FROM table_42087 WHERE "Women's singles" = 'kristína ludíková' AND "Year" > '2008' |
Which course has a higher workload - 579 or 411 ? | CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students int,heavy_assignments int,respe... | SELECT DISTINCT course.number FROM course, program_course WHERE (course.number = 579 OR course.number = 411) AND course.department = 'EECS' AND program_course.course_id = course.course_id ORDER BY program_course.workload DESC LIMIT 1 |
Name the 2003 for atp masters series 1998 | CREATE TABLE table_6204 ("Tournament" text,"1992" text,"1993" text,"1994" text,"1995" text,"1996" text,"1997" text,"1998" text,"1999" text,"2000" text,"2001" text,"2002" text,"2003" text,"2004" text,"2005" text,"2006" text,"Career SR" text,"Career Win-Loss" text) | SELECT "2003" FROM table_6204 WHERE "1998" = 'atp masters series' |
how many times does the episode called 'coop de grace' appear | CREATE TABLE table_16387 ("No. in series" real,"No. in season" real,"Title" text,"Director" text,"Writer(s)" text,"Original air date" text,"Production code" text) | SELECT COUNT("No. in series") FROM table_16387 WHERE "Title" = 'Coop de Grace' |
Bar graph to show the average of amount payment from different payment method code | CREATE TABLE Customers (Customer_ID INTEGER,Customer_Details VARCHAR(255))CREATE TABLE Settlements (Settlement_ID INTEGER,Claim_ID INTEGER,Date_Claim_Made DATE,Date_Claim_Settled DATE,Amount_Claimed INTEGER,Amount_Settled INTEGER,Customer_Policy_ID INTEGER)CREATE TABLE Customer_Policies (Policy_ID INTEGER,Customer_ID I... | SELECT Payment_Method_Code, AVG(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code |
When were this question's answers upvoted?. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,... | SELECT v.CreationDate AS "Vote Date", p.Id AS "Answer ID", p.CreationDate AS "Answer Date", p.Score AS "Answer Score", p.ParentId AS "Question ID", pp.CreationDate AS "Question Date", pp.Title AS "Question Title" FROM Posts AS p JOIN Posts AS pp ON p.ParentId = pp.Id JOIN Votes AS v ON v.PostId = p.Id WHERE pp.Id = 168... |
when patient 9297 received manual reduction hernia first in this year? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)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 icustays (row_id number,... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'manual reduction hernia') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9297) AND D... |
what was the last value of patient 022-44805's bun laboratory test since 12/2101? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE treatment (treatmen... | SELECT 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 = '022-44805')) AND lab.labname = 'bun' AND STRFTIME('%y-%m', lab.labresulttime) >= '2101-... |
What nationality has a pick of 1? | CREATE TABLE table_54014 ("Round" text,"Pick" text,"Player" text,"Position" text,"Nationality" text,"Team" text,"College" text) | SELECT "Nationality" FROM table_54014 WHERE "Pick" = '1' |
How many poles are there in the Formula Three Euroseries in the 2008 season with more than 0 F/Laps? | CREATE TABLE table_76208 ("Season" text,"Series" text,"Team" text,"Races" real,"Wins" real,"Poles" real,"F/Laps" real,"Points" text,"Position" text) | SELECT SUM("Poles") FROM table_76208 WHERE "Series" = 'formula three euroseries' AND "Season" = '2008' AND "F/Laps" > '0' |
Among patients with coronary artery disease or coronary artery bypass graft with mvr maze as their primary disease, calculate the number of those born before 2056 | 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.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE" AND demographic.dob_year < "2056" |
For those employees who was hired before 2002-06-21, a line chart shows the change of commission_pct over hire_date | CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME var... | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21' |
Which Constructor has the goodwood circuit? | CREATE TABLE table_name_53 (constructor VARCHAR,circuit VARCHAR) | SELECT constructor FROM table_name_53 WHERE circuit = "goodwood" |
Visualize a bar chart for what are the naems of all the projects, and how many scientists were assigned to each of them?, and I want to rank y axis in desc order. | CREATE TABLE AssignedTo (Scientist int,Project char(4))CREATE TABLE Scientists (SSN int,Name Char(30))CREATE TABLE Projects (Code Char(4),Name Char(50),Hours int) | SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name ORDER BY COUNT(*) DESC |
What is the average number of silver medals with more than 6 gold meals and less than 5 bronze medals? | CREATE TABLE table_71627 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT AVG("Silver") FROM table_71627 WHERE "Gold" > '6' AND "Bronze" < '5' |
How many average cuts made when 11 is the Top-10? | CREATE TABLE table_76027 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real) | SELECT AVG("Cuts made") FROM table_76027 WHERE "Top-10" = '11' |
What is the lowest draft number with a 48 pick? | CREATE TABLE table_name_94 (draft INTEGER,pick VARCHAR) | SELECT MIN(draft) FROM table_name_94 WHERE pick = 48 |
what is gender and admission location of subject name jane dillard? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob... | SELECT demographic.gender, demographic.admission_location FROM demographic WHERE demographic.name = "Jane Dillard" |
what is the garfield episode where us acres episode is banana nose? | CREATE TABLE table_22403 ("Episode" text,"Garfield Episode 1" text,"U.S. Acres Episode" text,"Garfield Episode 2" text,"Original Airdate" text) | SELECT "Garfield Episode 2" FROM table_22403 WHERE "U.S. Acres Episode" = 'Banana Nose' |
did patient 12775 receive a diagnosis on the current hospital visit? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug t... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775 AND admissions.dischtime IS NULL) |
A bar chart for what are the number of the phone numbers for each employee?, I want to list by the y axis in descending please. | CREATE TABLE Playlist (PlaylistId integer,Name varchar(120))CREATE TABLE Customer (CustomerId integer,FirstName varchar(40),LastName varchar(20),Company varchar(80),Address varchar(70),City varchar(40),State varchar(40),Country varchar(40),PostalCode varchar(10),Phone varchar(24),Fax varchar(24),Email varchar(60),Suppo... | SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY COUNT(Phone) DESC |
Which acquisition via has a position of forward and is on the state school or club? | CREATE TABLE table_40946 ("Name" text,"Position" text,"Number" real,"School/Club Team" text,"Season" text,"Acquisition via" text) | SELECT "Acquisition via" FROM table_40946 WHERE "Position" = 'forward' AND "School/Club Team" = 'state' |
give the number of male patients whose procedure icd9 code is 5732, | 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.gender = "M" AND procedures.icd9_code = "5732" |
Create a bar chart showing total number of meter 100 across meter 200, and rank y-axis from high to low order. | CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE stadiu... | SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY SUM(meter_100) DESC |
How many tries for are there when 11 were won? | CREATE TABLE table_21849 ("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 "Tries for" FROM table_21849 WHERE "Won" = '11' |
what is the number of patients whose admission type is urgent and diagnoses long title is electrolyte and fluid disorders 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 procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.long_title = "Electrolyte and fluid disorders not elsewhere classified" |
what is the admission location and lab test abnormal status for patient id 18480? | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do... | SELECT demographic.admission_location, lab.flag FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "18480" |
Find questions with 'script' in title that aren't tagged 'scripts'. | CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text... | SELECT Id AS "post_link", Tags FROM Posts WHERE PostTypeId = 1 AND Title LIKE '%script%' AND NOT Tags LIKE '%scripts%' ORDER BY CreationDate DESC |
Who was the EP winning team when the FM winning team was Brabham - Ford and the HM winning team was Osca? | CREATE TABLE table_31013 ("Rnd" text,"Circuit" text,"AP Winning Team" text,"BP Winning Team" text,"CM Winning Team" text,"CP Winning Team" text,"DM Winning Team" text,"DP Winning Team" text,"EM Winning Team" text,"EP Winning Team" text,"FM Winning Team" text,"FP Winning Team" text,"GM Winning Team" text,"GP Winning Tea... | SELECT "EP Winning Team" FROM table_31013 WHERE "FM Winning Team" = 'Brabham - Ford' AND "HM Winning Team" = 'Osca' |
Which Region has an area of 14,037km ? | CREATE TABLE table_name_70 (region VARCHAR,area__km²_ VARCHAR) | SELECT region FROM table_name_70 WHERE area__km²_ = "14,037" |
Who wrote the program that originally aired on June 6, 1999? | CREATE TABLE table_11008 ("Episode #" text,"Title" text,"Directed by" text,"Written by" text,"Original airdate" text) | SELECT "Written by" FROM table_11008 WHERE "Original airdate" = 'june 6, 1999' |
provide the number of patients whose diagnoses icd9 code is 58889 and lab test category is chemistry. | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "58889" AND lab."CATEGORY" = "Chemistry" |
Count the number of departments which offer courses. | CREATE TABLE course (course_id text,title text,dept_name text,credits number)CREATE TABLE section (course_id text,sec_id text,semester text,year number,building text,room_number text,time_slot_id text)CREATE TABLE student (id text,name text,dept_name text,tot_cred number)CREATE TABLE department (dept_name text,building... | SELECT COUNT(DISTINCT dept_name) FROM course |
What Bello has a 27 Liscumb and 6539 Libweshya? | CREATE TABLE table_57576 ("Ward" text,"Bello" text,"Ben-Tahir" text,"Doucet" text,"Furtenbacher" text,"Gauthier" text,"Haydon" text,"Larter" text,"Lawrance" text,"Libweshya" text,"Liscumb" text) | SELECT "Bello" FROM table_57576 WHERE "Liscumb" = '27' AND "Libweshya" = '6539' |
What was the race time of the horse with jockey Ramon Dominguez? | CREATE TABLE table_name_73 (time VARCHAR,jockey VARCHAR) | SELECT time FROM table_name_73 WHERE jockey = "ramon dominguez" |
What are the names of the channels owned by CCTV or HBS? | CREATE TABLE channel (name VARCHAR,OWNER VARCHAR) | SELECT name FROM channel WHERE OWNER = 'CCTV' OR OWNER = 'HBS' |
Name the least age for cibao central and santo domingo | CREATE TABLE table_24300 ("Province,Community" text,"Contestant" text,"Age" real,"Height" text,"Hometown" text,"Geographical Regions" text) | SELECT MIN("Age") FROM table_24300 WHERE "Geographical Regions" = 'Cibao Central' AND "Hometown" = 'Santo Domingo' |
For all employees who have the letters D or S in their first name, find job_id and the sum of employee_id , and group by attribute job_id, and visualize them by a bar chart, display in descending by the sum employee id. | CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),S... | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) DESC |
What sort of Fuel/Trans does the Grey & Red locomotive have? | CREATE TABLE table_51807 ("Name" text,"Built" text,"Wheels" text,"Fuel/ Trans" text,"Status" text,"Colour" text) | SELECT "Fuel/ Trans" FROM table_51807 WHERE "Colour" = 'grey & red' |
what was patient 009-15's first ward identification the previous year? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE microlab ... | SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-15') AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY patient.unitadmittime LIMIT 1 |
In what place was the song that had a draw of 3? | CREATE TABLE table_50794 ("Draw" real,"Artist" text,"Song" text,"Points" real,"Place" text) | SELECT "Place" FROM table_50794 WHERE "Draw" = '3' |
How many mls teams had player jamel wallace? | CREATE TABLE table_25518547_4 (mls_team VARCHAR,player VARCHAR) | SELECT COUNT(mls_team) FROM table_25518547_4 WHERE player = "Jamel Wallace" |
how many medals did senegal win ? | CREATE TABLE table_203_377 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "total" FROM table_203_377 WHERE "nation" = 'senegal' |
What is the platform of the 2010 game with Shuichiro Nishiya as director? | CREATE TABLE table_35804 ("Title" text,"Year" real,"Platform(s)" text,"Director" text,"Producer" text) | SELECT "Platform(s)" FROM table_35804 WHERE "Year" = '2010' AND "Director" = 'shuichiro nishiya' |
How many points have less than 126 2nd and nationality of aut? | CREATE TABLE table_6721 ("Rank" real,"Name" text,"Nationality" text,"1st (m)" real,"2nd (m)" real,"Points" real,"Overall NT points" text,"Overall WC points (Rank)" text) | SELECT SUM("Points") FROM table_6721 WHERE "2nd (m)" < '126' AND "Nationality" = 'aut' |
how much did patient 8098 weigh last measured? | 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 transfers (row_id number,subject_id number,hadm_id number,icus... | 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 = 8098)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' ... |
What type of record is the result of the game Montreal 31 @ Calgary 32? | CREATE TABLE table_21436373_5 (type_of_record VARCHAR,result_games VARCHAR) | SELECT type_of_record FROM table_21436373_5 WHERE result_games = "Montreal 31 @ Calgary 32" |
What is the college for the player that went to ridge community high school and is defensive back? | CREATE TABLE table_name_19 (college VARCHAR,position VARCHAR,school VARCHAR) | SELECT college FROM table_name_19 WHERE position = "defensive back" AND school = "ridge community high school" |
tell me the five year survival rate of patients who were prescribed lr after being diagnosed with cv dis nec-deliver w p/p? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,d... | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd... |
Name the kinship for *t-ina | CREATE TABLE table_20153 ("Kinship" text,"Proto-Austronesian" text,"Proto-Malayo-Polynesian" text,"Proto-Oceanic" text,"Proto-Polynesian" text) | SELECT "Kinship" FROM table_20153 WHERE "Proto-Malayo-Polynesian" = '*t-ina' |
Which open cup was after 1993? | CREATE TABLE table_name_18 (open_cup VARCHAR,year INTEGER) | SELECT open_cup FROM table_name_18 WHERE year > 1993 |
what was the last output on 12/27/2105 for patient 033-3992? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,pat... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-3992')) AND intakeoutput.cellpath LIKE '%output%' AND ST... |
Name the record with opponent atlanta falcons | CREATE TABLE table_646 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" real) | SELECT "Record" FROM table_646 WHERE "Opponent" = 'Atlanta Falcons' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.