instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
How much money does the player with a score of 74-71-76-76=297 have? | CREATE TABLE table_name_5 (money___$__ VARCHAR,score VARCHAR) | SELECT money___$__ FROM table_name_5 WHERE score = 74 - 71 - 76 - 76 = 297 |
What is the set 5 of the match with a set 2 of 26-24 and a set 1 of 27-25? | CREATE TABLE table_41984 ("Date" text,"Score" text,"Set 1" text,"Set 2" text,"Set 3" text,"Set 4" text,"Set 5" text,"Total" text) | SELECT "Set 5" FROM table_41984 WHERE "Set 2" = '26-24' AND "Set 1" = '27-25' |
How many burglary crimes were committed if the forcible rapes were 1233? | CREATE TABLE table_26060884_2 (burglary VARCHAR,forcible_rape VARCHAR) | SELECT burglary FROM table_26060884_2 WHERE forcible_rape = 1233 |
In which year did the least people enter hall of fame? | CREATE TABLE hall_of_fame (yearid VARCHAR) | SELECT yearid FROM hall_of_fame GROUP BY yearid ORDER BY COUNT(*) LIMIT 1 |
What is the average draft with a pick larger than 42, and player Grant Eakin after round 8? | CREATE TABLE table_61438 ("Draft" real,"Round" real,"Pick" real,"Player" text,"Nationality" text) | SELECT AVG("Draft") FROM table_61438 WHERE "Pick" > '42' AND "Player" = 'grant eakin' AND "Round" > '8' |
give me the number of patients whose diagnoses short title is chr kidney dis stage iv? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Chr kidney dis stage IV" |
For those employees who do not work in departments with managers that have ids between 100 and 200, find phone_number and department_id , and visualize them by a bar chart, rank by the bars from low to high please. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE jobs (JOB_ID var... | SELECT PHONE_NUMBER, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER |
What is the winning scor of the tournament with Robin Walton as the runner-up? | CREATE TABLE table_35293 ("Date" text,"Tournament" text,"Winning score" text,"Margin of victory" text,"Runner(s)-up" text) | SELECT "Winning score" FROM table_35293 WHERE "Runner(s)-up" = 'robin walton' |
when did patient 10211 since 2104 leave the hospital for the last time? | CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_typ... | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 10211 AND STRFTIME('%y', admissions.dischtime) >= '2104' ORDER BY admissions.dischtime DESC LIMIT 1 |
What are the ids of the two department store chains with the largest number of department stores? | CREATE TABLE department_stores (dept_store_chain_id VARCHAR) | SELECT dept_store_chain_id FROM department_stores GROUP BY dept_store_chain_id ORDER BY COUNT(*) DESC LIMIT 2 |
What team has brad miller (8) as the high assists? | CREATE TABLE table_46270 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Team" FROM table_46270 WHERE "High assists" = 'brad miller (8)' |
How many people had the high points when a. webb (7) had the high assists? | CREATE TABLE table_27882867_9 (high_points VARCHAR,high_assists VARCHAR) | SELECT COUNT(high_points) FROM table_27882867_9 WHERE high_assists = "A. Webb (7)" |
Name the tie that has 71 drawn | CREATE TABLE table_name_1 (tied VARCHAR,drawn VARCHAR) | SELECT tied FROM table_name_1 WHERE drawn = "71" |
Which player has a total bigger than 285 and a to par of +14? | CREATE TABLE table_name_10 (player VARCHAR,total VARCHAR,to_par VARCHAR) | SELECT player FROM table_name_10 WHERE total > 285 AND to_par = "+14" |
how many of the newborn admissions had item id 51300? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "NEWBORN" AND lab.itemid = "51300" |
Stacked bar chart of team_id for with each ACC_Home in each acc road, sort by the Y 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 ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY Team_ID |
ENGR 523 , how long has it been offered for ? | CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday... | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ENGR' AND course.number = 523 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1 |
Which Nation has Silver smaller than 16, Bronze larger than 6, and Gold of 2? | CREATE TABLE table_name_77 (nation VARCHAR,gold VARCHAR,silver VARCHAR,bronze VARCHAR) | SELECT nation FROM table_name_77 WHERE silver < 16 AND bronze > 6 AND gold = 2 |
Give me the comparison about Team_ID over the Team_Name by a bar chart, and could you rank in ascending by the bar please? | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)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_Perce... | SELECT Team_Name, Team_ID FROM basketball_match ORDER BY Team_Name |
What 300 -level courses are available in Fall or Winter terms ? | CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch... | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_id = course_of... |
Which Place has an English translation of lullaby for my beloved? | CREATE TABLE table_name_58 (place INTEGER,english_translation VARCHAR) | SELECT MAX(place) FROM table_name_58 WHERE english_translation = "lullaby for my beloved" |
What Shooter has a Total of 28? | CREATE TABLE table_59513 ("Shooter" text,"Event" text,"Rank points" text,"Score points" text,"Total" text) | SELECT "Shooter" FROM table_59513 WHERE "Total" = '28' |
How many pens does Siaosi Atiola have? | CREATE TABLE table_4924 ("Player" text,"Span" text,"Lost" text,"Draw" text,"Tries" text,"Conv" text,"Pens" text,"Drop" text) | SELECT "Pens" FROM table_4924 WHERE "Player" = 'siaosi atiola' |
display all the information for all employees who have the letters D or S in their first name and also arrange the result in descending order by salary. | CREATE TABLE employees (salary VARCHAR,first_name VARCHAR) | SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC |
what is minimum age of patients whose admission location is trsf within this facility and primary disease is s/p fall? | 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 MIN(demographic.age) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "S/P FALL" |
Who did Yugoslavia play against that led to a result of 2:3? | CREATE TABLE table_name_90 (opponent VARCHAR,results¹ VARCHAR) | SELECT opponent FROM table_name_90 WHERE results¹ = "2:3" |
What was the air date of 'Gary tries to do it all'? | CREATE TABLE table_50918 ("Episode" text,"Air Date" text,"Timeslot" text,"18-49" text,"Viewers" real) | SELECT "Air Date" FROM table_50918 WHERE "Episode" = 'gary tries to do it all' |
What are the last name and office of all history professors? | 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 student (stu_num number,stu_lname text,stu_fname text,stu_init text,stu_dob time,stu_hrs number,stu_clas... | SELECT T1.emp_lname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History' |
List the number of invoices from the US, grouped by state by a bar chart, and list X from high to low order. | CREATE TABLE albums (id INTEGER,title VARCHAR(160),artist_id INTEGER)CREATE TABLE employees (id INTEGER,last_name VARCHAR(20),first_name VARCHAR(20),title VARCHAR(30),reports_to INTEGER,birth_date TIMESTAMP,hire_date TIMESTAMP,address VARCHAR(70),city VARCHAR(40),state VARCHAR(40),country VARCHAR(40),postal_code VARCHA... | SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY billing_state DESC |
What is the sum of the evening gown scores where the interview score is less than 8.77, the swimsuit score is equal to 7.8, and the average score is less than 8.2? | CREATE TABLE table_54965 ("State" text,"Interview" real,"Swimsuit" real,"Evening gown" real,"Average" real) | SELECT SUM("Evening gown") FROM table_54965 WHERE "Interview" < '8.77' AND "Swimsuit" = '7.8' AND "Average" < '8.2' |
Before the year 1988, what is the lowest number of points that entrant Coloni SpA scored? | CREATE TABLE table_70395 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real) | SELECT MIN("Points") FROM table_70395 WHERE "Entrant" = 'coloni spa' AND "Year" < '1988' |
How many different kinds of information sources are there for injury accidents? | CREATE TABLE injury_accident (SOURCE VARCHAR) | SELECT COUNT(DISTINCT SOURCE) FROM injury_accident |
Users where location = melbourne. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId numbe... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Location, Reputation FROM Users WHERE LOWER(Location) LIKE LOWER('melbourne') ORDER BY Reputation DESC |
how did since 2101 patient 9297 last enter the hospital? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE d_items (row_id number,itemid number,label te... | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 9297 AND STRFTIME('%y', admissions.admittime) >= '2101' ORDER BY admissions.admittime DESC LIMIT 1 |
Which Chief Judge has Appointed by of reagan category:articles with hcards? | CREATE TABLE table_59400 ("State" text,"Born/Died" text,"Active service" text,"Chief Judge" text,"Senior status" text,"Appointed by" text,"Reason for termination" text) | SELECT "Chief Judge" FROM table_59400 WHERE "Appointed by" = 'reagan category:articles with hcards' |
Which Venue has a Notes of heptathlon, and a Year of 1991? | CREATE TABLE table_37025 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Notes" text) | SELECT "Venue" FROM table_37025 WHERE "Notes" = 'heptathlon' AND "Year" = '1991' |
How many episodes ran 24:33? | CREATE TABLE table_2102898_1 (episode VARCHAR,run_time VARCHAR) | SELECT COUNT(episode) FROM table_2102898_1 WHERE run_time = "24:33" |
ORDER BY - first posts by CreationDate. | CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE ReviewTaskResultTypes (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 num... | SELECT Id, CreationDate, Title, Body FROM dbo.Posts ORDER BY CreationDate LIMIT 10 |
Which Colony Name was Founded on january 19, 2012? | CREATE TABLE table_name_1 (colony_name VARCHAR,date_founded VARCHAR) | SELECT colony_name FROM table_name_1 WHERE date_founded = "january 19, 2012" |
give me the number of patients whose ethnicity is black/cape verdean and days of hospital stay is greater than 8? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.days_stay > "8" |
What is Laid Down, when Commissioned is '11 November 1989'? | CREATE TABLE table_61235 ("Ship" text,"Hull Number" text,"Laid down" text,"Launched" text,"Commissioned" text) | SELECT "Laid down" FROM table_61235 WHERE "Commissioned" = '11 november 1989' |
provide the number of patients whose gender is m and year of birth is less than 2101? | 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 WHERE demographic.gender = "M" AND demographic.dob_year < "2101" |
what was the name of the drug that was prescribed to patient 6940 in the same hospital encounter after they had been diagnosed with acute kidney failure nos in 11/last 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 procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE ... | SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 6940 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.sh... |
Name the total number of games for lost being 41 | CREATE TABLE table_27397 ("Season" text,"Games" real,"Won" real,"Lost" real,"Tied" real,"Points" real,"Goals for" real,"Goals against" real,"Standing" text) | SELECT COUNT("Games") FROM table_27397 WHERE "Lost" = '41' |
How many patients admitted before the year 2144 had tonsil and adenoid biopsy? | 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.admityear < "2144" AND procedures.short_title = "Tonsil&adenoid biopsy" |
What is the attendance for No. 15 tie? | CREATE TABLE table_50803 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Attendance" text) | SELECT "Attendance" FROM table_50803 WHERE "Tie no" = '15' |
had viral warts nos been diagnosed with patient 87733 until 2 years ago? | 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 prescriptions (row_id number,subject_id number,hadm_id number,st... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'viral warts nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 87733) AND DATETIME(diagnoses_icd.cha... |
What was the overall score when the score for set 3 is 21 25? | CREATE TABLE table_name_55 (score VARCHAR,set_3 VARCHAR) | SELECT score FROM table_name_55 WHERE set_3 = "21–25" |
In what season did Rusty Wallace win? | CREATE TABLE table_1769428_2 (season INTEGER,winning_driver VARCHAR) | SELECT MAX(season) FROM table_1769428_2 WHERE winning_driver = "Rusty Wallace" |
Which event had a total of 28? | CREATE TABLE table_name_51 (event VARCHAR,total VARCHAR) | SELECT event FROM table_name_51 WHERE total = "28" |
how many songs did ishaan dev provide for movies made between 2007 and 2009 ? | CREATE TABLE table_204_546 (id number,"year" number,"film" text,"song" text,"language" text) | SELECT COUNT("song") FROM table_204_546 WHERE "year" >= 2007 AND "year" <= 2009 |
What is the average round of the number 16 pick? | CREATE TABLE table_54067 ("Round" real,"Pick" text,"Player" text,"Position" text,"School/Club Team" text) | SELECT AVG("Round") FROM table_54067 WHERE "Pick" = '16' |
when did patient 018-81471 first get discharged from the hospital? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsyst... | SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '018-81471' ORDER BY patient.hospitaldischargetime LIMIT 1 |
What are the episode numbers of episodes featuring Hurley? | CREATE TABLE table_11562149_1 (no_in_series VARCHAR,featured_character_s_ VARCHAR) | SELECT no_in_series FROM table_11562149_1 WHERE featured_character_s_ = "Hurley" |
What did Luke S Zettlemoyer published in 2009 ? | CREATE TABLE field (fieldid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE jou... | SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'Luke S Zettlemoyer' AND paper.year = 2009 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid |
What are the ids and details of events that have more than one participants Visualize by bar chart, and I want to show by the y-axis from high to low. | CREATE TABLE Events (Event_ID INTEGER,Service_ID INTEGER,Event_Details VARCHAR(255))CREATE TABLE Services (Service_ID INTEGER,Service_Type_Code CHAR(15))CREATE TABLE Participants (Participant_ID INTEGER,Participant_Type_Code CHAR(15),Participant_Details VARCHAR(255))CREATE TABLE Participants_in_Events (Event_ID INTEGER... | SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_ID DESC |
Show me about the distribution of meter_500 and ID in a bar chart, could you order y axis in descending order please? | CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)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 event (ID int,Name text,Stadium_ID int,Year ... | SELECT meter_500, ID FROM swimmer ORDER BY ID DESC |
had patient 1114 ever had chest tube #1 output on this month/23? | 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 text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABL... | SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1114)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'chest tube #1' ... |
Who was the writer who wrote the episode that was aired on September 11, 1972? | CREATE TABLE table_25800134_17 (writer_s_ VARCHAR,airdate VARCHAR) | SELECT writer_s_ FROM table_25800134_17 WHERE airdate = "September 11, 1972" |
what is the number of patients whose admission type is elective and procedure long title is fiber-optic bronchoscopy? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Fiber-optic bronchoscopy" |
how many patients whose diagnoses short title is constipation nos and drug route is ed? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Constipation NOS" AND prescriptions.route = "ED" |
what tournament had sam querrey as the opponent? | CREATE TABLE table_69930 ("Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Tournament" FROM table_69930 WHERE "Opponent" = 'sam querrey' |
What is the smallest crowd when collingwood is home team? | CREATE TABLE table_4872 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT MIN("Crowd") FROM table_4872 WHERE "Home team" = 'collingwood' |
Show the average of price supplied by supplier id 3 for different product type code in a bar chart, rank y axis in desc order. | CREATE TABLE Departments (department_id INTEGER,dept_store_id INTEGER,department_name VARCHAR(80))CREATE TABLE Addresses (address_id INTEGER,address_details VARCHAR(255))CREATE TABLE Supplier_Addresses (supplier_id INTEGER,address_id INTEGER,date_from DATETIME,date_to DATETIME)CREATE TABLE Staff (staff_id INTEGER,staff... | SELECT product_type_code, AVG(product_price) FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 GROUP BY product_type_code ORDER BY AVG(product_price) DESC |
how many patients below the age of 56 were given voriconazole? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "56" AND prescriptions.drug = "Voriconazole" |
Who did Thomaz Bellucci play against when he became runner-up on a clay surface? | CREATE TABLE table_48013 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Opponent" FROM table_48013 WHERE "Outcome" = 'runner-up' AND "Surface" = 'clay' |
Who are the authors for the malasaurus of the vyazniki assemblage? | CREATE TABLE table_name_16 (authors VARCHAR,unit VARCHAR,name VARCHAR) | SELECT authors FROM table_name_16 WHERE unit = "vyazniki assemblage" AND name = "malasaurus" |
What is the lowest number of sunlight hours, and number of days with frost, more than 30, for the city of Ourense? | CREATE TABLE table_name_98 (sunlight_hours INTEGER,city_town VARCHAR,days_with_frost VARCHAR) | SELECT MIN(sunlight_hours) FROM table_name_98 WHERE city_town = "ourense" AND days_with_frost > 30 |
What city is the hidden valley raceway in? | CREATE TABLE table_35845 ("Event Circuit" text,"City / State" text,"Date" text,"Format" text,"Winner" text,"Team" text) | SELECT "City / State" FROM table_35845 WHERE "Event Circuit" = 'hidden valley raceway' |
What Gold has the Year of 2006? | CREATE TABLE table_name_56 (gold VARCHAR,year VARCHAR) | SELECT gold FROM table_name_56 WHERE year = 2006 |
What is the number of English names that have a Traditional Chinese name of ? | CREATE TABLE table_1982739_2 (english_name VARCHAR,traditional_chinese VARCHAR) | SELECT COUNT(english_name) FROM table_1982739_2 WHERE traditional_chinese = "全椒縣" |
Which station has programming of Me-TV? | CREATE TABLE table_name_33 (station VARCHAR,programming VARCHAR) | SELECT station FROM table_name_33 WHERE programming = "me-tv" |
WHich FCC info has 3,000 ERP W? | CREATE TABLE table_36372 ("Call sign" text,"Frequency MHz" real,"City of license" text,"ERP W" text,"Class" text,"FCC info" text) | SELECT "FCC info" FROM table_36372 WHERE "ERP W" = '3,000' |
For those employees who was hired before 2002-06-21, what is the relationship between commission_pct and manager_id ? | 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 job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE cou... | SELECT COMMISSION_PCT, MANAGER_ID FROM employees WHERE HIRE_DATE < '2002-06-21' |
Please give me a bar chart showing institution types, along with the number of institutions for each type. | CREATE TABLE building (building_id text,Name text,Street_address text,Years_as_tallest text,Height_feet int,Floors int)CREATE TABLE protein (common_name text,protein_name text,divergence_from_human_lineage real,accession_number text,sequence_length real,sequence_identity_to_human_protein text,Institution_id text)CREATE... | SELECT Type, COUNT(*) FROM Institution GROUP BY Type |
What is the most recent episode number written by Matthew Pitts? | CREATE TABLE table_24649082_1 (_number INTEGER,written_by VARCHAR) | SELECT MAX(_number) FROM table_24649082_1 WHERE written_by = "Matthew Pitts" |
Top Stackoveflow Programmers in India. | 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 ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE (LOWER(Location) LIKE '%stuttgart%' OR Location LIKE '%Stuttgart%') AND Reputation >= 1000 ORDER BY Reputation DESC |
What is the date of the game when the home team score is 11.11 (77)? | CREATE TABLE table_32444 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_32444 WHERE "Home team score" = '11.11 (77)' |
how many patients are diagnosed for the primary disease bowel obstruction and died in or before 2168? | 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 WHERE demographic.diagnosis = "BOWEL OBSTRUCTION" AND demographic.dod_year <= "2168.0" |
How many Russian patients stayed in the hospital for more than 69 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 demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.days_stay > "69" |
uncontrolled high blood pressure ( >= 140 / 90 mmhg ) | CREATE TABLE table_train_113 ("id" int,"mini_mental_state_examination_mmse" int,"systolic_blood_pressure_sbp" int,"body_weight" float,"diastolic_blood_pressure_dbp" int,"body_mass_index_bmi" float,"triglyceride_tg" float,"NOUSE" float) | SELECT * FROM table_train_113 WHERE systolic_blood_pressure_sbp >= 140 OR diastolic_blood_pressure_dbp >= 90 |
how many hours has elapsed since the first time patient 006-80884 had a tube feeding amount intake on the current intensive care unit visit? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid n... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... |
List all the event names by year from the most recent to the oldest. | CREATE TABLE event (name VARCHAR,YEAR VARCHAR) | SELECT name FROM event ORDER BY YEAR DESC |
What is the Format for the alca-487 catalog? | CREATE TABLE table_7667 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text) | SELECT "Format" FROM table_7667 WHERE "Catalog" = 'alca-487' |
What was the category of Richard Nixon as President in a year prior to 2009? | CREATE TABLE table_name_3 (category VARCHAR,president VARCHAR,year VARCHAR) | SELECT category FROM table_name_3 WHERE president = "richard nixon" AND year < 2009 |
For each director who directed more than one movie, for each movie title, bin their dates of release into Year interval and count the total number in each bucket using a line chart, and display by the x-axis from high to low please. | CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)CREATE TABLE Movie (mID int,title text,year int,director text) | SELECT year, COUNT(year) FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title GROUP BY title ORDER BY year DESC |
What is the total enrollment number of all colleges? | CREATE TABLE college (cname text,state text,enr number)CREATE TABLE tryout (pid number,cname text,ppos text,decision text)CREATE TABLE player (pid number,pname text,ycard text,hs number) | SELECT SUM(enr) FROM college |
Who was the minister for the CSV party with a present day end date? | CREATE TABLE table_name_43 (minister VARCHAR,party VARCHAR,end_date VARCHAR) | SELECT minister FROM table_name_43 WHERE party = "csv" AND end_date = "present day" |
What was the average attendance for games with a loss of papelbon (0 1)? | CREATE TABLE table_name_66 (attendance INTEGER,loss VARCHAR) | SELECT AVG(attendance) FROM table_name_66 WHERE loss = "papelbon (0–1)" |
What is the Time of the Player with a Rank of 2? | CREATE TABLE table_13988 ("Rank" real,"Athlete" text,"Country" text,"Time" text,"Notes" text) | SELECT "Time" FROM table_13988 WHERE "Rank" = '2' |
what is the number of patients with a personal history of antineoplastic chemotherapy diagnoses who have been admitted to the hospital on an emergency basis? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Personal history of antineoplastic chemotherapy" |
Who did the high rebounds in the game where Larry Hughes (21) did the high ponts? | CREATE TABLE table_23248869_6 (high_rebounds VARCHAR,high_points VARCHAR) | SELECT high_rebounds FROM table_23248869_6 WHERE high_points = "Larry Hughes (21)" |
What is the transfer window when moving to alianza atl tico by the name of v. zapata? | CREATE TABLE table_59438 ("Nat." text,"Name" text,"Moving to" text,"Type" text,"Transfer window" text) | SELECT "Transfer window" FROM table_59438 WHERE "Moving to" = 'alianza atlético' AND "Name" = 'v. zapata' |
Which outgoing manager has tabled 16th position? | CREATE TABLE table_name_83 (outgoing_manager VARCHAR,position_in_table VARCHAR) | SELECT outgoing_manager FROM table_name_83 WHERE position_in_table = "16th" |
Most popular StackOverflow tags in Q1 2015. | CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTask... | 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... |
return me the paper in PVLDB with the most citations . | CREATE TABLE domain_journal (did int,jid int)CREATE TABLE journal (homepage varchar,jid int,name varchar)CREATE TABLE domain_keyword (did int,kid int)CREATE TABLE domain (did int,name varchar)CREATE TABLE keyword (keyword varchar,kid int)CREATE TABLE organization (continent varchar,homepage varchar,name varchar,oid int... | SELECT publication.title FROM journal, publication WHERE journal.name = 'PVLDB' AND publication.jid = journal.jid ORDER BY publication.citation_num DESC LIMIT 1 |
What party does incumbent edwin reinecke represent? | CREATE TABLE table_1341738_6 (party VARCHAR,incumbent VARCHAR) | SELECT party FROM table_1341738_6 WHERE incumbent = "Edwin Reinecke" |
What 1995 has 1r as the 1999, and a 1998 of 4r? | CREATE TABLE table_34162 ("Tournament" text,"1990" text,"1991" text,"1992" text,"1993" text,"1994" text,"1995" text,"1996" text,"1997" text,"1998" text,"1999" text,"2000" text) | SELECT "1995" FROM table_34162 WHERE "1999" = '1r' AND "1998" = '4r' |
show me flights leaving from BALTIMORE to DALLAS | CREATE TABLE month (month_number int,month_name text)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distan... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALL... |
Where was the game in which Kevin Durant (25) did the most high points played? | CREATE TABLE table_23286112_6 (location_attendance VARCHAR,high_points VARCHAR) | SELECT location_attendance FROM table_23286112_6 WHERE high_points = "Kevin Durant (25)" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.