instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What is the lowest number of silver medals with a rank of 4 and total medals greater than 1? | CREATE TABLE table_name_68 (silver INTEGER,rank VARCHAR,total VARCHAR) | SELECT MIN(silver) FROM table_name_68 WHERE rank = 4 AND total > 1 |
count the number of patients whose age is less than 43 and lab test name is epithelial cells? | 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.age < "43" AND lab.label = "Epithelial Cells" |
what is the number of goals scored in the algarve cup on march 5 , 2002 ? | CREATE TABLE table_204_346 (id number,"#" number,"date" text,"venue" text,"opponent" text,"result" text,"competition" text,"scored" number) | SELECT "scored" FROM table_204_346 WHERE "date" = '5 march 2002' |
Who won in 1988 with a total less than 287? | CREATE TABLE table_64946 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text) | SELECT "Player" FROM table_64946 WHERE "Total" < '287' AND "Year(s) won" = '1988' |
what is the title of the episode with production code '2arg09'? | CREATE TABLE table_29439 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (millions)" text) | SELECT "Title" FROM table_29439 WHERE "Production code" = '2ARG09' |
what party had the least number of seats ? | CREATE TABLE table_203_798 (id number,"party" text,"votes" text,"%" number,"swing" number,"seats" number,"change" number) | SELECT "party" FROM table_203_798 ORDER BY "seats" LIMIT 1 |
What are the classes offered for Other next Winter ? | CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE ta (c... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour... |
How many people wrote the episode that had 7.26 million u.s. viewers? | CREATE TABLE table_28037619_2 (written_by VARCHAR,us_viewers__million_ VARCHAR) | SELECT COUNT(written_by) FROM table_28037619_2 WHERE us_viewers__million_ = "7.26" |
What is the largest number of laps with a Grid larger than 14, a Time/Retired of + 2 laps, and a Driver of helmut marko? | CREATE TABLE table_78424 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT MAX("Laps") FROM table_78424 WHERE "Grid" > '14' AND "Time/Retired" = '+ 2 laps' AND "Driver" = 'helmut marko' |
What are all the album titles, in alphabetical order? | CREATE TABLE album (albumid number,title text,artistid number)CREATE TABLE playlisttrack (playlistid number,trackid number)CREATE TABLE genre (genreid number,name text)CREATE TABLE artist (artistid number,name text)CREATE TABLE invoiceline (invoicelineid number,invoiceid number,trackid number,unitprice number,quantity ... | SELECT title FROM album ORDER BY title |
Where attendance is 79,431 what is date? | CREATE TABLE table_55954 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT "Date" FROM table_55954 WHERE "Attendance" = '79,431' |
how many patients whose diagnoses long title is cellulitis and abscess of leg, except foot and drug route is po? | 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.long_title = "Cellulitis and abscess of leg, except foot" AND prescriptions.route = "PO" |
Which Country has a Network of channel 1? | CREATE TABLE table_40037 ("Country" text,"Local name" text,"Host" text,"Network" text,"Date premiered" text) | SELECT "Country" FROM table_40037 WHERE "Network" = 'channel 1' |
neutrophil count >= 1500 / mm3 | CREATE TABLE table_dev_35 ("id" int,"white_blood_cell_count_wbc" int,"platelets" int,"neutrophil_count" int,"serum_creatinine" float,"albumin" float,"NOUSE" float) | SELECT * FROM table_dev_35 WHERE neutrophil_count >= 1500 |
how many companies had over $ 1,000,000 profit ? | CREATE TABLE table_203_320 (id number,"rank in\n2011" number,"name of\nconcern" text,"location of\nheadquarters" text,"revenue\n(thou.\npln)" number,"profit\n(thou.\npln)" number,"employees" number) | SELECT COUNT("name of\nconcern") FROM table_203_320 WHERE "profit\n(thou.\npln)" > 1000000 |
What are the played points difference? | CREATE TABLE table_name_82 (played VARCHAR,points_difference VARCHAR) | SELECT played FROM table_name_82 WHERE points_difference = "points difference" |
What chassis did the porsche flat-4 use before 1958? | CREATE TABLE table_80210 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real) | SELECT "Chassis" FROM table_80210 WHERE "Engine" = 'porsche flat-4' AND "Year" < '1958' |
What number (#) is associated with the Name Ron Baxter? | CREATE TABLE table_12032893_1 (_number VARCHAR,name VARCHAR) | SELECT COUNT(_number) FROM table_12032893_1 WHERE name = "Ron Baxter" |
Draw a bar chart of name versus age, and I want to rank by the x axis in asc. | CREATE TABLE editor (Editor_ID int,Name text,Age real)CREATE TABLE journal (Journal_ID int,Date text,Theme text,Sales int)CREATE TABLE journal_committee (Editor_ID int,Journal_ID int,Work_Type text) | SELECT Name, Age FROM editor ORDER BY Name |
Which Margin of victory has a Runner(s)-up of mark o'meara? | CREATE TABLE table_name_19 (margin_of_victory VARCHAR,runner_s__up VARCHAR) | SELECT margin_of_victory FROM table_name_19 WHERE runner_s__up = "mark o'meara" |
what is the number of patients who were admitted before the year 2115 for insertion of non-drug-eluting coronary artery stent(s)? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2115" AND procedures.long_title = "Insertion of non-drug-eluting coronary artery stent(s)" |
What is the sequencer when ion torrent pgm is 200-400 bp? | CREATE TABLE table_17773 ("Sequencer" text,"Ion Torrent PGM" text,"454 GS FLX" text,"HiSeq 2000" text,"SOLiDv4" text,"PacBio" text,"Sanger 3730xl" text) | SELECT "Sequencer" FROM table_17773 WHERE "Ion Torrent PGM" = '200-400 bp' |
give me the number of patients whose admission type is emergency and lab test name is creatine kinase, mb isoenzyme? | 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 lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Creatine Kinase, MB Isoenzyme" |
How much absorption in nm does the orange dye have? | CREATE TABLE table_26428602_1 (absorb__nm_ INTEGER,color VARCHAR) | SELECT MIN(absorb__nm_) FROM table_26428602_1 WHERE color = "orange" |
how many games were played in september 1978 ? | CREATE TABLE table_204_565 (id number,"game" number,"date" text,"opponent" text,"venue" text,"result" text,"attendance" number,"goalscorers" text) | SELECT COUNT(*) FROM table_204_565 WHERE "date" = 9 AND "date" = 1978 |
Which year has a total of 0 points and a chassis of Toleman tg181? | CREATE TABLE table_name_88 (year INTEGER,points VARCHAR,chassis VARCHAR) | SELECT AVG(year) FROM table_name_88 WHERE points = 0 AND chassis = "toleman tg181" |
I want to see International Economics courses of 3 credits . | CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE area (course_id int,area varchar)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE ... | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%International Economics%' OR name LIKE '%International Economics%') AND credits = 3 |
What episode number in the series was directed by John Behring? | CREATE TABLE table_24187 ("No in Series" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real,"U.S. viewers (millions)" text) | SELECT MAX("No in Series") FROM table_24187 WHERE "Directed by" = 'John Behring' |
What was the home score for the Home team Melbourne? | CREATE TABLE table_10710 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team score" FROM table_10710 WHERE "Home team" = 'melbourne' |
When 1927 is the founded year how many measurements of enrollment in 2012 are there? | CREATE TABLE table_2076516_1 (enrollment__2012_ VARCHAR,founded VARCHAR) | SELECT COUNT(enrollment__2012_) FROM table_2076516_1 WHERE founded = 1927 |
how many patients died after being diagnosed in 2104 with hematuria in the same hospital encounter? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE cost (cos... | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ... |
What is the census ranking for the community with an area smaller than 9.94 km2 and a population smaller than 817? | CREATE TABLE table_name_93 (census_ranking VARCHAR,area_km_2 VARCHAR,population VARCHAR) | SELECT census_ranking FROM table_name_93 WHERE area_km_2 < 9.94 AND population < 817 |
What is the away team when the home team is Cheltenham Town? | CREATE TABLE table_name_5 (away_team VARCHAR,home_team VARCHAR) | SELECT away_team FROM table_name_5 WHERE home_team = "cheltenham town" |
which competition did this competitor compete in next after the world indoor championships in 2008 ? | CREATE TABLE table_204_622 (id number,"year" number,"competition" text,"venue" text,"position" text,"event" text,"notes" text) | SELECT "competition" FROM table_204_622 WHERE id = (SELECT id FROM table_204_622 WHERE "competition" = 'world indoor championships' AND "year" = 2008) + 1 |
What is the subject when the highest mark is 79? | CREATE TABLE table_29842201_1 (subject VARCHAR,highest_mark VARCHAR) | SELECT subject FROM table_29842201_1 WHERE highest_mark = 79 |
Which 2010 stat featured the tournament of the Olympic Games? | CREATE TABLE table_name_2 (tournament VARCHAR) | SELECT 2010 FROM table_name_2 WHERE tournament = "olympic games" |
Which Position has a Player of patrick macdonald? | CREATE TABLE table_56631 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text) | SELECT "Position" FROM table_56631 WHERE "Player" = 'patrick macdonald' |
Which Perth's gold coast and Adelaide were yes when Auckland was no? | CREATE TABLE table_68328 ("Sydney" text,"Melbourne" text,"Perth" text,"Adelaide" text,"Gold Coast" text,"Auckland" text) | SELECT "Perth" FROM table_68328 WHERE "Gold Coast" = 'yes' AND "Adelaide" = 'yes' AND "Auckland" = 'no' |
Show me a bar chart comparing the total number of captains of different classes, order from high to low by the the number of class. | CREATE TABLE captain (Captain_ID int,Name text,Ship_ID int,age text,Class text,Rank text)CREATE TABLE Ship (Ship_ID int,Name text,Type text,Built_Year real,Class text,Flag text) | SELECT Class, COUNT(Class) FROM captain GROUP BY Class ORDER BY COUNT(Class) DESC |
Percent closed per canonical tag. | CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl... | WITH canon AS (SELECT Tags.Id, Count, Tags.TagName AS otag, COALESCE(c.TargetTagName, b.TargetTagName, a.TargetTagName, TagName) AS tagname FROM Tags LEFT JOIN TagSynonyms AS a ON (a.SourceTagName = TagName) LEFT JOIN TagSynonyms AS b ON (b.SourceTagName = a.TargetTagName) LEFT JOIN TagSynonyms AS c ON (c.SourceTagName... |
Find those themes and years for all exhibitions with ticket prices lower than 15, show me a stacked bar chart that groups by themes, counts year, and the x-axis is Year. | CREATE TABLE artist (Artist_ID int,Name text,Country text,Year_Join int,Age int)CREATE TABLE exhibition_record (Exhibition_ID int,Date text,Attendance int)CREATE TABLE exhibition (Exhibition_ID int,Year int,Theme text,Artist_ID int,Ticket_Price real) | SELECT Year, COUNT(Year) FROM exhibition WHERE Ticket_Price < 15 GROUP BY Theme |
Name the county for mccain being 38.78% | CREATE TABLE table_23739 ("County" text,"Obama%" text,"Obama#" real,"McCain%" text,"McCain#" real,"Others%" text,"Others#" real,"Total" real) | SELECT "County" FROM table_23739 WHERE "McCain%" = '38.78%' |
what is the overall number of times when the calendar showed october 6 | CREATE TABLE table_29866 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT COUNT("Record") FROM table_29866 WHERE "Date" = 'October 6' |
What is the admission time and for how many days did the subject id 4333 stay in the hospital? | 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 lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT demographic.days_stay, demographic.admittime FROM demographic WHERE demographic.subject_id = "4333" |
How many different set of candidates were there when the incumbent was david e. finley? | CREATE TABLE table_1346137_4 (candidates VARCHAR,incumbent VARCHAR) | SELECT COUNT(candidates) FROM table_1346137_4 WHERE incumbent = "David E. Finley" |
how many patients have stayed in the hospital for more than 14 days with a ou drug route? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "14" AND prescriptions.route = "OU" |
What was the nationality of the sunk ship named Rinos? | CREATE TABLE table_name_52 (nationality VARCHAR,fate VARCHAR,ship VARCHAR) | SELECT nationality FROM table_name_52 WHERE fate = "sunk" AND ship = "rinos" |
What livery belongs to the steam Locomotive type builder that was building before 1989? | CREATE TABLE table_name_69 (livery VARCHAR,year_built VARCHAR,locomotive_type VARCHAR) | SELECT livery FROM table_name_69 WHERE year_built < 1989 AND locomotive_type = "steam" |
For those employees who did not have any job in the past, give me the trend about department_id over hire_date , I want to order in desc by the X-axis. | 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 countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE locations (LOCAT... | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE DESC |
Who is the player from round 8? | CREATE TABLE table_50913 ("Round" real,"Player" text,"Position" text,"Nationality" text,"College/Junior/Club Team (League)" text) | SELECT "Player" FROM table_50913 WHERE "Round" = '8' |
What is Gold, when Total is 6? | CREATE TABLE table_name_79 (gold VARCHAR,total VARCHAR) | SELECT gold FROM table_name_79 WHERE total = 6 |
who won the election after s. sivaprakasam in the fifth pondicherry assembly ? | CREATE TABLE table_204_54 (id number,"pondicherry assembly" text,"duration" text,"name of m.l.a." text,"party affiliation" text,"election year" number) | SELECT "name of m.l.a." FROM table_204_54 WHERE "pondicherry assembly" = 'fifth' |
Top 10 tags with top 5 tags. | CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CR... | SELECT Tags FROM Posts WHERE Tags IN (SELECT Tags FROM Tags ORDER BY Count DESC LIMIT 10) LIMIT 5 |
How many premio are there when 'Artist of the Year' was the categoria? | CREATE TABLE table_29563 ("A\u00f1o" real,"Trabajo nominado" text,"Premio" text,"Categor\u00eda" text,"Country" text,"Resultado" text) | SELECT COUNT("Premio") FROM table_29563 WHERE "Categor\u00eda" = 'Artist of the Year' |
Can you tell me the highest Points that has the Played smaller than 30? | CREATE TABLE table_name_67 (points INTEGER,played INTEGER) | SELECT MAX(points) FROM table_name_67 WHERE played < 30 |
what is drug route and drug dose of drug name miconazole 2% cream? | 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 prescriptions.route, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Miconazole 2% Cream" |
Name the total number of weeks for si te vas and peak less than 7 and year less than 2000 | CREATE TABLE table_75128 ("Year" real,"Chart" text,"Track" text,"Peak" real,"Weeks on Chart" real) | SELECT COUNT("Weeks on Chart") FROM table_75128 WHERE "Track" = 'si te vas' AND "Peak" < '7' AND "Year" < '2000' |
What is the minimum sum? | CREATE TABLE table_30281 ("Position" text,"Number" real,"Player" text,"Super League" real,"Champions League" real,"Swiss Cup" real,"Total" real) | SELECT MIN("Total") FROM table_30281 |
what was the total replete w/fiber dose for patient 22517? | CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_... | SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22517)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab... |
What is the name for the 2012 CN Sabadell? | CREATE TABLE table_9225 ("Name" text,"Pos." text,"Height" text,"Weight" text,"2012 club" text) | SELECT "Name" FROM table_9225 WHERE "2012 club" = 'cn sabadell' |
Which Saturday has a Name of confederation? | CREATE TABLE table_name_68 (saturday VARCHAR,name VARCHAR) | SELECT saturday FROM table_name_68 WHERE name = "confederation" |
find the number of patients who were born before the year 2120 and their drug route is ivpca. | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2120" AND prescriptions.route = "IVPCA" |
Find the last names of the members of the club 'Bootup Baltimore'. | CREATE TABLE club (clubid number,clubname text,clubdesc text,clublocation text)CREATE TABLE member_of_club (stuid number,clubid number,position text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text) | SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" |
does each congressman have a party listed ? | CREATE TABLE table_203_409 (id number,"rank" number,"representative" text,"party" text,"district" text,"seniority date" text,"notes" text) | SELECT COUNT(*) = 0 FROM table_203_409 WHERE "party" IS NULL |
what year had the most candidates elected ? | CREATE TABLE table_203_330 (id number,"year of election" number,"candidates elected" number,"# of seats available" number,"# of votes" number,"% of popular vote" text) | SELECT "year of election" FROM table_203_330 ORDER BY "candidates elected" DESC LIMIT 1 |
just count how many patients have been prescribed spironolactone in 2105. | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE d_icd_diagnoses (row_id... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'spironolactone' AND STRFTIME('%y', prescriptions.startdate) = '2105') |
What are the different first names for customers from Brazil who have also had an invoice? | CREATE TABLE playlisttrack (playlistid number,trackid number)CREATE TABLE artist (artistid number,name text)CREATE TABLE invoiceline (invoicelineid number,invoiceid number,trackid number,unitprice number,quantity number)CREATE TABLE invoice (invoiceid number,customerid number,invoicedate time,billingaddress text,billin... | SELECT DISTINCT T1.firstname FROM customer AS T1 JOIN invoice AS T2 ON T1.customerid = T2.customerid WHERE T1.country = "Brazil" |
What is the highest number listed? | CREATE TABLE table_17426 ("Number" real,"Builder" text,"Built" text,"Rebuilt" text,"Name as rebuilt" text,"Scrapped/Sold" text) | SELECT MAX("Number") FROM table_17426 |
what is the most expensive flight from BOSTON to DALLAS | CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE airport_service (city_code varchar,airport_code varchar,... | 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.... |
Which polling firm put T. Papadopoulos at 31%? | CREATE TABLE table_name_91 (polling_firm VARCHAR,t_papadopoulos VARCHAR) | SELECT polling_firm FROM table_name_91 WHERE t_papadopoulos = "31%" |
is the total score for december 26 the same score as january 2 ? | CREATE TABLE table_203_517 (id number,"#" number,"date" text,"visitor" text,"score" text,"home" text,"record" text,"pts" number) | SELECT (SELECT "score" FROM table_203_517 WHERE "date" = 'december 26') = (SELECT "score" FROM table_203_517 WHERE "date" = 'january 2') |
what is the last d5 1/2ns dose that patient 65962 was prescribed in 05/2103? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)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_icd_diagnoses (row_id number,icd9_code... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65962) AND prescriptions.drug = 'd5 1/2ns' AND STRFTIME('%y-%m', prescriptions.startdate) = '2103-05' ORDER BY prescriptions.startdate DESC LIMIT 1 |
How many poles were there in 1996? | CREATE TABLE table_2508 ("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 MIN("Poles") FROM table_2508 WHERE "Year" = '1996' |
when was patient 007-16517 prescribed for the last time a medication via inhale medication in the current hospital visit? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid nu... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-16517' AND patient.hospitaldischargetime IS NULL)) AND med... |
How many teams were in the series championnat de france formula renault 2.0? | CREATE TABLE table_26124171_1 (team VARCHAR,series VARCHAR) | SELECT team FROM table_26124171_1 WHERE series = "Championnat de France Formula Renault 2.0" |
is patient 25696's urea nitrogen last measured on the last hospital visit greater than second to last measured on the last hospital visit? | 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 microbiologyevents (row_id number,subject_id number,hadm_id nu... | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25696 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.l... |
How man 3-dart averages did gary anderson have? | CREATE TABLE table_24549777_1 (player VARCHAR) | SELECT COUNT(3 AS _dart_average) FROM table_24549777_1 WHERE player = "Gary Anderson" |
What is the area of the civil parish kilworth and townland monadrishane? | CREATE TABLE table_30120556_1 (area__acres__ VARCHAR,civil_parish VARCHAR,townland VARCHAR) | SELECT area__acres__ FROM table_30120556_1 WHERE civil_parish = "Kilworth" AND townland = "Monadrishane" |
WHAT IS THE NAME WITH 01.0 10 light street? | CREATE TABLE table_61421 ("Name" text,"Street address" text,"Years as tallest" text,"Height ft (m)" text,"Floors" real) | SELECT "Name" FROM table_61421 WHERE "Street address" = '01.0 10 light street' |
What is the location when KO is the method, the result is a win, and the record is 2-0? | CREATE TABLE table_61734 ("Result" text,"Record" text,"Opponent" text,"Method" text,"Location" text) | SELECT "Location" FROM table_61734 WHERE "Method" = 'ko' AND "Result" = 'win' AND "Record" = '2-0' |
For all storms with at least 1 death, show me the name and the total number of deaths with a bar chart, order by the bar in descending. | CREATE TABLE region (Region_id int,Region_code text,Region_name text)CREATE TABLE affected_region (Region_id int,Storm_ID int,Number_city_affected real)CREATE TABLE storm (Storm_ID int,Name text,Dates_active text,Max_speed int,Damage_millions_USD real,Number_Deaths int) | SELECT Name, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Name DESC |
What bran is the callsign dytc-fm? | CREATE TABLE table_28307 ("Branding" text,"Callsign" text,"Frequency" text,"Power (kW)" text,"Location" text) | SELECT "Branding" FROM table_28307 WHERE "Callsign" = 'DYTC-FM' |
Who write episode number 48 in the series? | CREATE TABLE table_2453243_5 (written_by VARCHAR,no_in_series VARCHAR) | SELECT written_by FROM table_2453243_5 WHERE no_in_series = "48" |
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of job_id and commission_pct in a bar chart, and order in asc by the y axis. | 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 regions (RE... | SELECT JOB_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT |
For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of job_id and the average of employee_id , and group by attribute job_id, and show Y-axis in descending order. | 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 jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN... | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) DESC |
What is the smallest sales area (m ) that has 4,094/m and more than 2 stores? | CREATE TABLE table_4413 ("Country" text,"Sales (X1000)" text,"No. of stores" real,"Sales area (m\u00b2)" real,"Sales per area" text,"Average store size (m\u00b2)" real) | SELECT MIN("Sales area (m\u00b2)") FROM table_4413 WHERE "Sales per area" = '€4,094/m²' AND "No. of stores" > '2' |
What is the highest Current Branch Opened, when Neighborhood is W. Portland Park? | CREATE TABLE table_41561 ("Branch" text,"Address" text,"Neighborhood" text,"First branch opened" real,"Current branch opened" real) | SELECT MAX("Current branch opened") FROM table_41561 WHERE "Neighborhood" = 'w. portland park' |
what is the maximum age of patients primarily diagnosed with posterior communicating aneurysm/sda before the admission year 2203? | 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 MAX(demographic.age) FROM demographic WHERE demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA" AND demographic.admityear >= "2203" |
On what Date is there a Home team score of 8.15 (63)? | CREATE TABLE table_4590 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_4590 WHERE "Home team score" = '8.15 (63)' |
What 300 -level classes do you have available for the Spring or Summer term ? | CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE instructor (instructor... | 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 ('SP', 'SS', 'SU') AND semester.semester_id = cou... |
What was the attendance when Essendon played as the home team? | CREATE TABLE table_54764 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT COUNT("Crowd") FROM table_54764 WHERE "Home team" = 'essendon' |
Return a bar chart on what is the state and enrollment of the colleges where have any students who got accepted in the tryout decision. | CREATE TABLE College (cName varchar(20),state varchar(2),enr numeric(5,0))CREATE TABLE Tryout (pID numeric(5,0),cName varchar(20),pPos varchar(8),decision varchar(3))CREATE TABLE Player (pID numeric(5,0),pName varchar(20),yCard varchar(3),HS numeric(5,0)) | SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' |
how many total cars did chevrolet manufacture ? | CREATE TABLE table_204_604 (id number,"year" number,"date" text,"driver" text,"team" text,"manufacturer" text,"race distance\nlaps" number,"race distance\nmiles (km)" text,"race time" text,"average speed\n(mph)" number,"report" text) | SELECT COUNT(*) FROM table_204_604 WHERE "manufacturer" = 'chevrolet' |
What is the highest crude death rate when deaths are 3 433 and average population is greater than 298? | CREATE TABLE table_13038 ("Average population (x 1000)" real,"Live births" text,"Deaths" text,"Natural change" text,"Crude birth rate (per 1000)" real,"Crude death rate (per 1000)" real,"Natural change (per 1000)" real) | SELECT MAX("Crude death rate (per 1000)") FROM table_13038 WHERE "Deaths" = '3 433' AND "Average population (x 1000)" > '298' |
How tall is nerlens noel? | CREATE TABLE table_57174 ("Player" text,"Height" text,"School" text,"Hometown" text,"College" text) | SELECT "Height" FROM table_57174 WHERE "Player" = 'nerlens noel' |
What is the number of 40 to 44 when the 50 to 54 is less than 4,184, and the 15 to 17 is less than 3? | CREATE TABLE table_77332 ("C/W 15+" real,"Oblast\\Age" text,"15 to 17" real,"18 to 19" real,"20 to 24" real,"25 to 29" real,"30 to 34" real,"35 to 39" real,"40 to 44" real,"45 to 49" real,"50 to 54" real,"55 to 59" real,"60 to 64" real,"65 to 69" real) | SELECT COUNT("40 to 44") FROM table_77332 WHERE "50 to 54" < '4,184' AND "15 to 17" < '3' |
Who directed the film that Avie Luthra received an award for? | CREATE TABLE table_name_63 (director_s_ VARCHAR,recipient VARCHAR) | SELECT director_s_ FROM table_name_63 WHERE recipient = "avie luthra" |
What is the home score with a crowd larger than 25,603? | CREATE TABLE table_56904 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team score" FROM table_56904 WHERE "Crowd" > '25,603' |
What 2006 has q2 as the 2007? | CREATE TABLE table_name_34 (Id VARCHAR) | SELECT 2006 FROM table_name_34 WHERE 2007 = "q2" |
what were the three most frequent drugs prescribed to patients with an age 60 or above after they had been diagnosed with adv eff arom analgsc nec during a year before within 2 months? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABL... | SELECT t3.drug FROM (SELECT t2.drug, 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.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.