instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
When was Tree Cornered Tweety, directed by Friz Freleng, released?
CREATE TABLE table_63015 ("Title" text,"Series" text,"Director" text,"Release date" text,"reissue?" text)
SELECT "Release date" FROM table_63015 WHERE "Director" = 'friz freleng' AND "Title" = 'tree cornered tweety'
when was patient 010-16572's systemicdiastolic measured for the first time until 1 day ago?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,ob...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-16572')) AND NOT vitalperiodic.systemicdiastoli...
What the highest Year with a Remixed by Laurent Boutonnat?
CREATE TABLE table_35568 ("Version" text,"Length" text,"Album" text,"Remixed by" text,"Year" real)
SELECT MAX("Year") FROM table_35568 WHERE "Remixed by" = 'laurent boutonnat'
What rank was the swimmer in lane 4?
CREATE TABLE table_13821 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"Time" text)
SELECT "Rank" FROM table_13821 WHERE "Lane" = '4'
How many grids does dave walker have?
CREATE TABLE table_78427 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT COUNT("Grid") FROM table_78427 WHERE "Driver" = 'dave walker'
Respostas de um usu rio deletado. Para ver as pergunta, troque o PostTypeId para 1. Para ver tudo, remova-o.
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score n...
SELECT CreationDate, Id AS "post_link" FROM Posts AS p WHERE OwnerDisplayName = '##NomeDoUsuario:string##' AND PostTypeId = 2 ORDER BY CreationDate
How many titles were written by Don Shank and Genndy Tartakovsky?
CREATE TABLE table_2156758_4 (title VARCHAR,written_by VARCHAR)
SELECT COUNT(title) FROM table_2156758_4 WHERE written_by = "Don Shank and Genndy Tartakovsky"
What are the most popular first words in question titles?.
CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE ReviewTaskResultTypes (...
SELECT SUBSTRING(p.Title, 1, STR_POSITION(p.Title, ' ')) AS FirstWord, COUNT(DISTINCT p.Id) AS Questions, CAST(AVG(p.Score * 1.0) AS FLOAT(10, 1)) AS AvgScore, CAST(AVG(p.AnswerCount * 1.0) AS FLOAT(10, 1)) AS AvgAnswerCount, CAST(AVG(p.CommentCount * 1.0) AS FLOAT(10, 1)) AS AvgCommentCount, CAST(AVG(p.ViewCount * 1.0...
How many times is avg/g 2?
CREATE TABLE table_66517 ("Name" text,"GP-GS" text,"Receptions" real,"Long" real,"Avg/G" real)
SELECT COUNT("Receptions") FROM table_66517 WHERE "Avg/G" = '2'
which was the only race held in cameroon ?
CREATE TABLE table_204_409 (id number,"date" text,"race name" text,"location" text,"uci rating" number,"winner" text,"team" text)
SELECT "race name" FROM table_204_409 WHERE "location" = 'cameroon'
what are the three most commonly given lab tests for patients who have previously received pancreat sphincteroplas during the same month during this 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 labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,val...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i...
What is the ethnic group is ?
CREATE TABLE table_2562572_39 (largest_ethnic_group__2002_ VARCHAR,cyrillic_name_other_names VARCHAR)
SELECT largest_ethnic_group__2002_ FROM table_2562572_39 WHERE cyrillic_name_other_names = "Конак"
What year shows as Runner-up of england (24 pts)?
CREATE TABLE table_name_6 (year VARCHAR,runner_up VARCHAR)
SELECT year FROM table_name_6 WHERE runner_up = "england (24 pts)"
How many sacks have 2006 as the year, and a solo less than 62?
CREATE TABLE table_68107 ("Year" text,"Team" text,"TTkl" real,"Solo" real,"Sacks" real,"Pass Def" real)
SELECT SUM("Sacks") FROM table_68107 WHERE "Year" = '2006' AND "Solo" < '62'
What is the highest number of wins that has a top-25 of 13 and events less than 32?
CREATE TABLE table_name_76 (wins INTEGER,top_25 VARCHAR,events VARCHAR)
SELECT MAX(wins) FROM table_name_76 WHERE top_25 = 13 AND events < 32
Which Money has a Score of 70-68-73-68=279?
CREATE TABLE table_50256 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real)
SELECT MIN("Money ( $ )") FROM table_50256 WHERE "Score" = '70-68-73-68=279'
what is lab test abnormal status of subject name paul edwards?
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 procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT lab.flag FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Paul Edwards"
To fulfill the MDE requirement , what 's the easiest class I can take ?
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, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou...
Where did South Melbourne play as the home team?
CREATE TABLE table_58109 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Venue" FROM table_58109 WHERE "Home team" = 'south melbourne'
For those employees who did not have any job in the past, for manager_id, hire_date, visualize the trend, and sort by the X in ascending.
CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE ...
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE
Bottom 20 askers on the site. A list of the top 500 users with the highest average answer score excluding community wiki / closed posts or users with less than 10 answers
CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score num...
SELECT Users.Id AS "user_link", COUNT(Posts.Id) AS Questions, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_question_score" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY Users.Id, DisplayName HAVING COUNT(Posts.Id) ...
Show the protein name and the institution name.
CREATE TABLE protein (protein_name VARCHAR,institution_id VARCHAR)CREATE TABLE institution (institution VARCHAR,institution_id VARCHAR)
SELECT T2.protein_name, T1.institution FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id
Name the average Wins which has a Top 10 smaller than 0?
CREATE TABLE table_name_5 (wins INTEGER,top_10 INTEGER)
SELECT AVG(wins) FROM table_name_5 WHERE top_10 < 0
What is the sum of the points when there are fewer than 4 games?
CREATE TABLE table_39117 ("Games" real,"Drawn" real,"Lost" real,"Points difference" text,"Points" real)
SELECT SUM("Points") FROM table_39117 WHERE "Games" < '4'
who was the first team that the badgers faced this season ?
CREATE TABLE table_204_615 (id number,"date" text,"opponent" text,"result" text,"goal scorers (season goals)" text,"goalie saves" text,"attendance" text)
SELECT "opponent" FROM table_204_615 ORDER BY id LIMIT 1
Return a histogram on how many entrepreneurs correspond to each investor?, and could you list bars from high to low order?
CREATE TABLE people (People_ID int,Name text,Height real,Weight real,Date_of_Birth text)CREATE TABLE entrepreneur (Entrepreneur_ID int,People_ID int,Company text,Money_Requested real,Investor text)
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor ORDER BY Investor DESC
What is Steve Lowery's Place?
CREATE TABLE table_45151 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Place" FROM table_45151 WHERE "Player" = 'steve lowery'
what is the daily minimum value of patient 006-195316's weight since 09/2103?
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 patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid...
SELECT MIN(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195316') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) >= '2103-09' GROUP BY STRFTIME('%y-%m-%d', patie...
What is the rank number for a placing of 28.5 and a total less than 92.7?
CREATE TABLE table_55934 ("Rank" real,"Name" text,"Nation" text,"Placings" text,"Total" real)
SELECT COUNT("Rank") FROM table_55934 WHERE "Placings" = '28.5' AND "Total" < '92.7'
What shareholder has 3.63 percent of capital?
CREATE TABLE table_206419_3 (shareholder VARCHAR,percent_of_capital VARCHAR)
SELECT shareholder FROM table_206419_3 WHERE percent_of_capital = "3.63"
What was the height of representative #6?
CREATE TABLE table_28062822_3 (height VARCHAR,represent VARCHAR)
SELECT height FROM table_28062822_3 WHERE represent = 6
Which Team has a Score of 108-105 (ot)?
CREATE TABLE table_42526 ("Game" real,"Date" text,"Team" text,"Score" text,"Location Attendance" text,"Record" text)
SELECT "Team" FROM table_42526 WHERE "Score" = '108-105 (ot)'
What is the highest 1995 with a 1990 less than 36, a 1987 less than 1987, and a 2007 value greater than 107?
CREATE TABLE table_name_4 (Id VARCHAR)
SELECT MAX(1995) FROM table_name_4 WHERE 1990 > 36 AND 1987 < 1987 AND 2007 > 107
How many classes are there available next semester ?
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 COUNT(DISTINCT course_offering.course_id) FROM course_offering, semester WHERE semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
For years before 1996, having a rank of 3rd in the 125cc class, what is the sum of the points?
CREATE TABLE table_69841 ("Year" real,"Class" text,"Team" text,"Points" real,"Rank" text,"Wins" real)
SELECT SUM("Points") FROM table_69841 WHERE "Class" = '125cc' AND "Rank" = '3rd' AND "Year" < '1996'
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of last_name and employee_id , could you display in desc by the 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 regions (REGION_ID decimal(5,0),REGIO...
SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC
What percentage of users were using Safari during the period in which 2.33% were using Opera?
CREATE TABLE table_name_3 (safari VARCHAR,opera VARCHAR)
SELECT safari FROM table_name_3 WHERE opera = "2.33%"
give me the flights from BOSTON to SAN FRANCISCO leaving early today
CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE dual_carrier (main_ai...
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 (((flight.departure_time BETWEEN 1000 AND 0) AND date_day.day_number = 13 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_nam...
What are the minimum and maximum crime rate of counties?
CREATE TABLE county_public_safety (Crime_rate INTEGER)
SELECT MIN(Crime_rate), MAX(Crime_rate) FROM county_public_safety
give me the number of patients whose drug code is lope2?
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 diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "LOPE2"
procalcitonin >= 2 ng / ml when entering the intensive care unit ( icu )
CREATE TABLE table_train_13 ("id" int,"active_infection" bool,"procalcitonin" int,"receiving_vasopressor" bool,"sepsis" bool,"septic_shock" bool,"age" float,"lactate" int,"NOUSE" float)
SELECT * FROM table_train_13 WHERE procalcitonin >= 2
how many patients admitted before the year 2120 had the lab test item id 51044?
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.admityear < "2120" AND lab.itemid = "51044"
What is the average crowd size when fitzroy plays at home?
CREATE TABLE table_name_41 (crowd INTEGER,home_team VARCHAR)
SELECT AVG(crowd) FROM table_name_41 WHERE home_team = "fitzroy"
Guess NAA flags on AU by comments.
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 CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwne...
SELECT 'http://stackoverflow.com/questions/' + CAST(c.PostId AS TEXT) FROM Comments AS c INNER JOIN Posts AS p ON (p.Id = c.PostId) WHERE c.Text LIKE '%This does not provide an answer to the question.%' AND c.Score >= 0 AND p.Score <= 0 AND NOT EXISTS(SELECT * FROM PostHistory AS h WHERE PostHistoryTypeId IN (12, 13) A...
How many classes are held in each department?
CREATE TABLE course (crs_code text,dept_code text,crs_description text,crs_credit number)CREATE TABLE enroll (class_code text,stu_num number,enroll_grade text)CREATE TABLE employee (emp_num number,emp_lname text,emp_fname text,emp_initial text,emp_jobcode text,emp_hiredate time,emp_dob time)CREATE TABLE professor (emp_...
SELECT COUNT(*), dept_code FROM class AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code GROUP BY dept_code
Most popular tag in June 2017.
CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId...
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS MayRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AN...
Show me a stacked bar graph, the x-axis is the nationality of ship, and the y-axis is their total number of different nationality and split by ship type, and could you display y axis in descending order?
CREATE TABLE ship (Ship_ID int,Name text,Type text,Nationality text,Tonnage int)CREATE TABLE mission (Mission_ID int,Ship_ID int,Code text,Launched_Year int,Location text,Speed_knots int,Fate text)
SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Type, Nationality ORDER BY COUNT(Nationality) DESC
How many rounds is the fight against Michael Chavez?
CREATE TABLE table_name_46 (round INTEGER,opponent VARCHAR)
SELECT AVG(round) FROM table_name_46 WHERE opponent = "michael chavez"
hiv or hepatitis b or c positive status
CREATE TABLE table_train_173 ("id" int,"hiv_infection" bool,"hemoglobin_a1c_hba1c" float,"hepatitis_c" bool,"hepatitis_b" bool,"cirrhosis" bool,"renal_disease" bool,"hepatic_disease" bool,"allergy_to_egg" bool,"estimated_glomerular_filtration_rate_egfr" int,"NOUSE" float)
SELECT * FROM table_train_173 WHERE hiv_infection = 1 OR hepatitis_c = 1 OR hepatitis_b = 1
Out of the total number of patients admitted before 2154, caluclate the number of those who had urinary incontinence nos.
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2154" AND diagnoses.short_title = "Urinary incontinence NOS"
What nationality is Demetris Nichols?
CREATE TABLE table_name_1 (nationality VARCHAR,player VARCHAR)
SELECT nationality FROM table_name_1 WHERE player = "demetris nichols"
Which party has Peter A. Quinn as a representative?
CREATE TABLE table_80457 ("Representative" text,"Years" text,"State" text,"Party" text,"Lifespan" text)
SELECT "Party" FROM table_80457 WHERE "Representative" = 'peter a. quinn'
how many patients whose discharge location is rehab/distinct part hosp and lab test name is osmolality, measured?
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 demographic (subject_id text,hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND lab.label = "Osmolality, Measured"
What School is in the kio kio area?
CREATE TABLE table_name_60 (name VARCHAR,area VARCHAR)
SELECT name FROM table_name_60 WHERE area = "kio kio"
Where did a home team score 8.14 (62)?
CREATE TABLE table_53364 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Venue" FROM table_53364 WHERE "Home team score" = '8.14 (62)'
Who was the opponent in week 6?
CREATE TABLE table_name_89 (opponent VARCHAR,week VARCHAR)
SELECT opponent FROM table_name_89 WHERE week = 6
give me the number of patients whose admission type is urgent and year of birth is less than 2078?
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 WHERE demographic.admission_type = "URGENT" AND demographic.dob_year < "2078"
Who was the incoming head coach after Wan Jamak Wan Hassan quit the coaching job?
CREATE TABLE table_29171931_3 (incoming_head_coach VARCHAR,outgoing_head_coach VARCHAR)
SELECT incoming_head_coach FROM table_29171931_3 WHERE outgoing_head_coach = "Wan Jamak Wan Hassan"
Retrieve all the first and last names of authors in the alphabetical order of last names.
CREATE TABLE authors (fname VARCHAR,lname VARCHAR)
SELECT fname, lname FROM authors ORDER BY lname
what was the first value of the pao2 lab test of patient 004-32407 on their first hospital visit.
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number...
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 = '004-32407' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmit...
Tell me the label for digital download for bonus tracks version
CREATE TABLE table_4336 ("Region" text,"Date" text,"Format" text,"Label" text,"Edition(s)" text)
SELECT "Label" FROM table_4336 WHERE "Format" = 'digital download' AND "Edition(s)" = 'bonus tracks version'
what was the name of the procedure that patient 90369 received two times until 11/2105.
CREATE TABLE d_labitems (row_id number,itemid number,label text)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 diagnoses_icd (row_id number,subject_id num...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 903...
When the Crowd is larger than 23,327, what Home team is playing?
CREATE TABLE table_58080 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team" FROM table_58080 WHERE "Crowd" > '23,327'
Find the names of the campus which has more faculties in 2002 than every campus in Orange county.
CREATE TABLE faculty (campus number,year number,faculty number)CREATE TABLE degrees (year number,campus number,degrees number)CREATE TABLE csu_fees (campus number,year number,campusfee number)CREATE TABLE enrollments (campus number,year number,totalenrollment_ay number,fte_ay number)CREATE TABLE campuses (id number,cam...
SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND faculty > (SELECT MAX(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND T1.county = "Orange")
Men's singles of kilian pfister, and a Women's doubles of astrid eidenbenz claudia jehle has what average year?
CREATE TABLE table_5887 ("Year" real,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text)
SELECT AVG("Year") FROM table_5887 WHERE "Men's singles" = 'kilian pfister' AND "Women's doubles" = 'astrid eidenbenz claudia jehle'
Show different publishers together with the number of publications they have in a pie chart.
CREATE TABLE publication (Publication_ID int,Book_ID int,Publisher text,Publication_Date text,Price real)CREATE TABLE book (Book_ID int,Title text,Issues real,Writer text)
SELECT Publisher, COUNT(*) FROM publication GROUP BY Publisher
What was the home team when the visiting team was Toronto?
CREATE TABLE table_78394 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text)
SELECT "Home" FROM table_78394 WHERE "Visitor" = 'toronto'
How many laps does jean-christophe boullion have with a time/retired of +1 lap?
CREATE TABLE table_name_67 (laps VARCHAR,time_retired VARCHAR,driver VARCHAR)
SELECT laps FROM table_name_67 WHERE time_retired = "+1 lap" AND driver = "jean-christophe boullion"
What is the Notes of the Country with a Rank of 4?
CREATE TABLE table_65423 ("Rank" real,"Rowers" text,"Country" text,"Time" text,"Notes" text)
SELECT "Notes" FROM table_65423 WHERE "Rank" = '4'
What is the college of dave adams, who has a pick greater than 7?
CREATE TABLE table_50321 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT "College" FROM table_50321 WHERE "Pick" > '7' AND "Name" = 'dave adams'
What team played in front of 28,536 at an away stadium?
CREATE TABLE table_56436 ("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_56436 WHERE "Crowd" > '28,536'
Ratio of upvotes to views. Displays the questions with the greatest ratio of upvotes to views, for questions with at least a given number of views. This helps to find the true gems, where looking at just upvotes tends to favour questions that have hit the Top Network Questions and received a ton of views.
CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number...
SELECT p.Id AS "post_link", p.OwnerUserId AS "user_link", SUM(CASE WHEN v.VoteTypeId = 2 THEN 1 ELSE 0 END) - SUM(CASE WHEN v.VoteTypeId = 3 THEN 1 ELSE 0 END) AS "netupvotes", p.ViewCount AS "views", ROUND(CAST(SUM(CASE WHEN v.VoteTypeId = 2 THEN 1 ELSE 0 END) - SUM(CASE WHEN v.VoteTypeId = 3 THEN 1 ELSE 0 END) AS FLO...
What is the kit manufacturer that has billy bonds as the manager?
CREATE TABLE table_name_36 (kit_manufacturer VARCHAR,manager VARCHAR)
SELECT kit_manufacturer FROM table_name_36 WHERE manager = "billy bonds"
Show different locations and the number of performances at each location. Visualize by bar chart.
CREATE TABLE member (Member_ID text,Name text,Nationality text,Role text)CREATE TABLE performance (Performance_ID real,Date text,Host text,Location text,Attendance int)CREATE TABLE member_attendance (Member_ID int,Performance_ID int,Num_of_Pieces int)
SELECT Location, COUNT(*) FROM performance GROUP BY Location
For those dates that have the 5 highest cloud cover rates, please bin the date into Year interval and compute their average cloud cover.
CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE status (station_id INTEGER,bikes_available INTEGER,docks_available INTEGER,time TEXT)CREATE TABLE weather (date TEXT,max_temperature_f INTEGER,mean_temperature_f INTEGER,min_temperature_f...
SELECT date, AVG(cloud_cover) FROM weather
what city is the largest by surface area ?
CREATE TABLE table_203_731 (id number,"pos." text,"city" text,"population\n(ab)" number,"surface\n(km2)" number,"density\n(ab/km2)" number,"altitude\n(mslm)" number)
SELECT "city" FROM table_203_731 ORDER BY "surface\n(km2)" DESC LIMIT 1
How many different starts had an average finish of 17.9?
CREATE TABLE table_28450 ("Year" real,"Starts" real,"Wins" real,"Top 5" real,"Top 10" real,"Poles" real,"Avg. Start" text,"Avg. Finish" text,"Winnings" text,"Position" text,"Team(s)" text)
SELECT COUNT("Starts") FROM table_28450 WHERE "Avg. Finish" = '17.9'
what is patient 42396's last careunit until 2101?
CREATE TABLE d_labitems (row_id number,itemid number,label 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 transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid numbe...
SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 42396) AND NOT transfers.careunit IS NULL AND STRFTIME('%y', transfers.intime) <= '2101' ORDER BY transfers.intime DESC LIMIT 1
Return a bar chart on how many events are there for each party?, could you display by the Y-axis in asc?
CREATE TABLE region (Region_ID int,Region_name text,Date text,Label text,Format text,Catalogue text)CREATE TABLE party_events (Event_ID int,Event_Name text,Party_ID int,Member_in_charge_ID int)CREATE TABLE party (Party_ID int,Minister text,Took_office text,Left_office text,Region_ID int,Party_name text)CREATE TABLE mem...
SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY COUNT(*)
LHC 399 is taught by Stephen Lusmann ?
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,predicted_graduation_semester int,degree varchar,minor varchar,internship varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id ...
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'LHC' AND course.number = 399 AND instructor.name LIKE '%Stephen Lusmann%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor...
How many gold have a National of New Zealand with a total less than 2?
CREATE TABLE table_name_15 (gold INTEGER,nation VARCHAR,total VARCHAR)
SELECT SUM(gold) FROM table_name_15 WHERE nation = "new zealand" AND total < 2
how many patients diagnosed with b-complex defic nec had their urine sample tested by lab?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "B-complex defic NEC" AND lab.fluid = "Urine"
Name the # for youtube
CREATE TABLE table_15781170_2 (_number VARCHAR,poll_winner VARCHAR)
SELECT _number FROM table_15781170_2 WHERE poll_winner = "YouTube"
Which label has a date of 1987?
CREATE TABLE table_70017 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalogue" text)
SELECT "Label" FROM table_70017 WHERE "Date" = '1987'
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of headquarter and the average of manufacturer , and group by attribute headquarter, and order from low to high by the y axis.
CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)
SELECT Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Manufacturer)
Filtered \\ corruption null accepted posts.
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,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TA...
SELECT p.Id AS "post_link", 'site://posts/' + CAST(p.Id AS TEXT) + '/edit|' + 'Edit' AS "edit_link", p.CreationDate FROM Posts AS p WHERE 1 = 1 AND (NOT (p.AcceptedAnswerId != p.Id) OR p.AcceptedAnswerId IS NULL) AND YEAR(p.CreationDate) = @year AND (REPLACE(REPLACE(p.Body, '\\', ''), ' ', 'X') LIKE '%\XXXX%') AND (p.O...
When did lucy benjamin exit?
CREATE TABLE table_37906 ("Celebrity" text,"Famous for" text,"Entered" text,"Exited" text,"Finished" text)
SELECT "Exited" FROM table_37906 WHERE "Celebrity" = 'lucy benjamin'
R versus Python tags - quotient Py/R.
CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE ...
SELECT DATE(CAST(t.yr AS TEXT(4)) + '-' + CAST(t.mnth AS TEXT(2)) + '-01') AS dt, (CASE WHEN t.r_mnth_count = 0 THEN NULL ELSE CAST(t.py_mnth_count AS FLOAT) / CAST(t.r_mnth_count AS FLOAT) END) AS py_div_r FROM (SELECT MONTH(CreationDate) AS mnth, YEAR(CreationDate) AS yr, SUM(CASE WHEN Tags LIKE '%<r>%' THEN 1 ELSE 0...
count the number of patients whose primary disease is abdominal abscess and year of death is less than or equal to 2179?
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 procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ABDOMINAL ABSCESS" AND demographic.dod_year <= "2179.0"
What is the lowest positioned team with 2 wins and losses greater than 13?
CREATE TABLE table_59271 ("Position" real,"Club" text,"Games played" real,"Wins" real,"Draws" real,"Loses" real,"Goals scored" real,"Goals conceded" real,"Points" real)
SELECT MIN("Position") FROM table_59271 WHERE "Wins" = '2' AND "Loses" > '13'
Name the municpality for 57 populaton
CREATE TABLE table_1428 ("Municipality" text,"Population" text,"Inhabitants per km\u00b2" real,"Area (in km\u00b2)" real,"Markatal" real,"Island" text,"Region" text)
SELECT "Municipality" FROM table_1428 WHERE "Population" = '57'
Among patients admitted before 2151, how many of them had item ID 51100?
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 demographic (subject_id text,hadm_id text,name text,marita...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2151" AND lab.itemid = "51100"
please give me all the flights from LONG BEACH CALIFORNIA to MEMPHIS TENNESSEE
CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,gro...
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, state AS STATE_0, state AS STATE_1 WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'LONG BEACH' AND CITY_1.city_code = AIRPORT_SERVICE_1.c...
Which college is aligned to the Saskatchewan Roughriders?
CREATE TABLE table_16327 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text)
SELECT "College" FROM table_16327 WHERE "CFL Team" = 'Saskatchewan Roughriders'
What is the highest number of goals against when the number of goals were 55 and the difference was +24?
CREATE TABLE table_43782 ("Position" real,"Team" text,"Played" real,"Drawn" real,"Lost" real,"Goals For" real,"Goals Against" real,"Goal Difference" text,"Points 1" text)
SELECT MAX("Goals Against") FROM table_43782 WHERE "Goals For" > '55' AND "Goal Difference" = '+24'
Find the number of hispanic or latino-puerto rican patients who were taking repaglinide medication.
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)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 t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.drug = "Repaglinide"
Tell me the dimension that has a range of 8,000 10,000
CREATE TABLE table_name_57 (dimension__m_ VARCHAR,range__km_ VARCHAR)
SELECT dimension__m_ FROM table_name_57 WHERE range__km_ = "8,000 – 10,000"
when did until 3 years ago patient 025-23610 first receive angiotensin ii receptor blocker (arb) - losartan?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE lab (labid number,patientunitstayid number,lab...
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-23610')) AND treatment.treatmentname = 'angiotensin ii recept...
Who was the opponent when the series was at 1-3?
CREATE TABLE table_name_86 (opponent VARCHAR,series VARCHAR)
SELECT opponent FROM table_name_86 WHERE series = "1-3"
Give me the trend about the date_to attributes of all researchers, and bin the date_to into Year interval, display by the x-axis from low to high.
CREATE TABLE Grants (grant_id INTEGER,organisation_id INTEGER,grant_amount DECIMAL(19,4),grant_start_date DATETIME,grant_end_date DATETIME,other_details VARCHAR(255))CREATE TABLE Project_Outcomes (project_id INTEGER,outcome_code VARCHAR(10),outcome_details VARCHAR(255))CREATE TABLE Documents (document_id INTEGER,docume...
SELECT date_to, COUNT(date_to) FROM Project_Staff ORDER BY date_to