instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What is the fewest number of points scored by Goulds' Garage (Bristol), engines of Maserati Straight-6, in years before 1956? | CREATE TABLE table_name_41 (points INTEGER,year VARCHAR,entrant VARCHAR,engine VARCHAR) | SELECT MIN(points) FROM table_name_41 WHERE entrant = "goulds' garage (bristol)" AND engine = "maserati straight-6" AND year < 1956 |
How many events have each participants attended? Show their total number by each participant type code using a bar chart, rank in asc by the total number of count(*). | CREATE TABLE Services (Service_ID INTEGER,Service_Type_Code CHAR(15))CREATE TABLE Events (Event_ID INTEGER,Service_ID INTEGER,Event_Details VARCHAR(255))CREATE TABLE Participants_in_Events (Event_ID INTEGER,Participant_ID INTEGER)CREATE TABLE Participants (Participant_ID INTEGER,Participant_Type_Code CHAR(15),Participa... | SELECT T1.Participant_Type_Code, SUM(COUNT(*)) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_Type_Code ORDER BY SUM(COUNT(*)) |
how many hours have elapsed since the last time patient 005-87465 had an intake of norepinephrine on the current icu visit? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid numbe... | 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 ... |
On what date(s) was the winning team Prema Powerteam? | CREATE TABLE table_3247 ("Round" real,"Circuit" text,"Date" text,"Pole Position" text,"Fastest Lap" text,"Winning Driver" text,"Winning Team" text) | SELECT "Date" FROM table_3247 WHERE "Winning Team" = 'Prema Powerteam' |
which judge began active service first , wayne edward alley or james henry alesia ? | CREATE TABLE table_203_572 (id number,"judge" text,"court" text,"began active\nservice" text,"ended active\nservice" text,"ended senior\nstatus" text) | SELECT "judge" FROM table_203_572 WHERE "judge" IN ('wayne edward alley', 'james henry alesia') ORDER BY "began active\nservice" LIMIT 1 |
What is the average down (up to kbit/s) when the provider is willy.tel and the up (kbit/s) is more than 1984? | CREATE TABLE table_name_73 (down__up_to_kbit_s_ INTEGER,provider VARCHAR,up__up_to_kbit_s_ VARCHAR) | SELECT AVG(down__up_to_kbit_s_) FROM table_name_73 WHERE provider = "willy.tel" AND up__up_to_kbit_s_ > 1984 |
how many times does patient 010-1155 have a po liqs intake on the first icu visit? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-1155') AND NOT patient.unitdischargetime IS NULL ORDER BY patient.unit... |
What date has 2006 fifa world cup qualification as the competition, and alamodome, san antonio, united States as the venue? | CREATE TABLE table_name_40 (date VARCHAR,competition VARCHAR,venue VARCHAR) | SELECT date FROM table_name_40 WHERE competition = "2006 fifa world cup qualification" AND venue = "alamodome, san antonio, united states" |
Who won the 350cc at Sachsenring? | CREATE TABLE table_name_90 (track VARCHAR) | SELECT 350 AS _cc FROM table_name_90 WHERE track = "sachsenring" |
What is the name of the tournament with 11 or more events a top-5 of 0 and a top-25 of 2? | CREATE TABLE table_40323 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real) | SELECT "Tournament" FROM table_40323 WHERE "Events" > '11' AND "Top-5" = '0' AND "Top-25" = '2' |
Line chart, let hire data as X and salary as Y, and filter for employees without the letter M in their first name, display by the x axis in ascending. | 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 jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE cou... | SELECT HIRE_DATE, SALARY FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY HIRE_DATE |
Show the number of venue from each venue | CREATE TABLE workshop (Workshop_ID int,Date text,Venue text,Name text)CREATE TABLE Acceptance (Submission_ID int,Workshop_ID int,Result text)CREATE TABLE submission (Submission_ID int,Scores real,Author text,College text) | SELECT Venue, COUNT(Venue) FROM workshop GROUP BY Venue |
What is the largest amount of wins of someone who has an against score greater than 1249 and a number of losses less than 17? | CREATE TABLE table_58322 ("Mid Gippsland FL" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real) | SELECT MAX("Wins") FROM table_58322 WHERE "Against" > '1249' AND "Losses" < '17' |
For those employees who do not work in departments with managers that have ids between 100 and 200, find last_name and salary , and visualize them by a bar chart. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,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 departments (DEP... | SELECT LAST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) |
what did patient 033-3992's age be during this hospital encounter? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT patient.age FROM patient WHERE patient.uniquepid = '033-3992' AND patient.hospitaldischargetime IS NULL |
What shows for 2006 when 2000 is 1r, 1996 is A, and Tournament is Cincinnati Masters? | CREATE TABLE table_50783 ("Tournament" text,"1990" text,"1991" text,"1992" text,"1993" text,"1994" text,"1995" text,"1996" text,"1997" text,"1998" text,"1999" text,"2000" text,"2001" text,"2002" text,"2003" text,"2004" text,"2005" text,"2006" text,"2007" text,"2008" text) | SELECT "2006" FROM table_50783 WHERE "2000" = '1r' AND "1996" = 'a' AND "Tournament" = 'cincinnati masters' |
Stacked bar chart of team_id for with each ACC_Home in each acc road | 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 |
how many patients were prescribed sodium chloride 0.9% 500 ml lvp within 2 months after the diagnosis of sepsis, since 2103? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE diagnosis (diagnosi... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'sepsis' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2103') AS t1 JOIN (SELECT patient.uniquepid, medicat... |
what countries have the same amount of bronze medals as germany ? | CREATE TABLE table_203_653 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT COUNT("nation") FROM table_203_653 WHERE "nation" <> 'germany' AND "bronze" = (SELECT "bronze" FROM table_203_653 WHERE "nation" = 'germany') |
patients with no indication for enteral feeding or in the imminence of receiving parenteral nutrition | CREATE TABLE table_train_64 ("id" int,"hiv_infection" bool,"receiving_parenteral_nutrition" bool,"hypertriglyceridemia" bool,"enteral_feeding" bool,"body_mass_index_bmi" float,"diarrhea" bool,"NOUSE" float) | SELECT * FROM table_train_64 WHERE enteral_feeding = 0 OR receiving_parenteral_nutrition = 1 |
What department has an m.phil (physics) qualification? | CREATE TABLE table_44284 ("College code" text,"Faculty name" text,"Designation" text,"Qualification" text,"Department" text,"Experience" text) | SELECT "Department" FROM table_44284 WHERE "Qualification" = 'm.phil (physics)' |
Tell me the home team for vfl park venue | CREATE TABLE table_name_21 (home_team VARCHAR,venue VARCHAR) | SELECT home_team FROM table_name_21 WHERE venue = "vfl park" |
Answers containing search term for questions that don't. | 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 answers.Id AS "post_link" FROM Posts AS questions INNER JOIN Posts AS answers ON answers.ParentId = questions.Id WHERE NOT (questions.Body LIKE '%shaken%') AND answers.Body LIKE '%shaken%' |
At what time was the game when they played the White Sox and had a record of 63-70? | CREATE TABLE table_37927 ("Date" text,"Time" text,"Opponent" text,"Score" text,"Loss" text,"Record" text) | SELECT "Time" FROM table_37927 WHERE "Opponent" = 'white sox' AND "Record" = '63-70' |
What team played South Melbourne at their home game? | CREATE TABLE table_57431 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team" FROM table_57431 WHERE "Home team" = 'south melbourne' |
Which Res has a Time of 11:58? | CREATE TABLE table_61332 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Res." FROM table_61332 WHERE "Time" = '11:58' |
Loses of 2, and a Pos. smaller than 2 had how many highest matches? | CREATE TABLE table_name_75 (matches INTEGER,loses VARCHAR,pos VARCHAR) | SELECT MAX(matches) FROM table_name_75 WHERE loses = 2 AND pos < 2 |
Where does Iceland rank with under 19 silvers? | CREATE TABLE table_name_12 (rank INTEGER,nation VARCHAR,silver VARCHAR) | SELECT MAX(rank) FROM table_name_12 WHERE nation = "iceland" AND silver < 19 |
What song was in french? | CREATE TABLE table_name_98 (song VARCHAR,language VARCHAR) | SELECT song FROM table_name_98 WHERE language = "french" |
What did the home team score at Princes Park? | CREATE TABLE table_53393 ("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_53393 WHERE "Venue" = 'princes park' |
What is the name of the building at the Jewellery quarter? | CREATE TABLE table_name_61 (name VARCHAR,location VARCHAR) | SELECT name FROM table_name_61 WHERE location = "jewellery quarter" |
Catalogue of Comments Including <idownvotedbecau.se> Links. | CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName te... | SELECT Id AS "comment_link" FROM Comments LIMIT 100 |
Name the head of household for married filing jointly or qualified widow(er) being $137,051 $208,850 | CREATE TABLE table_name_32 (head_of_household VARCHAR,married_filing_jointly_or_qualified_widow_er_ VARCHAR) | SELECT head_of_household FROM table_name_32 WHERE married_filing_jointly_or_qualified_widow_er_ = "$137,051–$208,850" |
List all information about college sorted by enrollment number in the ascending order. | CREATE TABLE player (pid number,pname text,ycard text,hs number)CREATE TABLE college (cname text,state text,enr number)CREATE TABLE tryout (pid number,cname text,ppos text,decision text) | SELECT * FROM college ORDER BY enr |
tell me what was the top three most common diagnosis since 4 years ago? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname... | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 3 |
most popular new tags by votes. | CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body ... | SELECT ROW_NUMBER() OVER (ORDER BY Votes.Votes DESC) AS VoteRank, Votes.TagName AS Tag, Votes.Votes AS "Votes " FROM (SELECT Tags.TagName, COUNT(DISTINCT Votes.Id) AS Votes FROM Tags, PostTags, Posts, Votes WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostTags.PostId AND Votes.PostId = Posts.Id AND Votes.CreationDate ... |
What was the record on 12 march 2008? | CREATE TABLE table_name_63 (record VARCHAR,date VARCHAR) | SELECT record FROM table_name_63 WHERE date = "12 march 2008" |
for the name of joe surratt what is the last update? | CREATE TABLE table_name_75 (last_update VARCHAR,name VARCHAR) | SELECT last_update FROM table_name_75 WHERE name = "joe surratt" |
Which Total has a Bronze larger than 1, and a Gold larger than 0? | CREATE TABLE table_name_57 (total INTEGER,bronze VARCHAR,gold VARCHAR) | SELECT MAX(total) FROM table_name_57 WHERE bronze > 1 AND gold > 0 |
What is the Result where Goal is 9? | CREATE TABLE table_70866 ("Goal" real,"Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Result" FROM table_70866 WHERE "Goal" = '9' |
Who were the opponents for the event in Milan, Italy? | CREATE TABLE table_44146 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partnering" text,"Opponent" text,"Score" text) | SELECT "Opponent" FROM table_44146 WHERE "Tournament" = 'milan, italy' |
Who was the opponent at the game with a result of w 14 6? | CREATE TABLE table_36169 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text) | SELECT "Opponent" FROM table_36169 WHERE "Result" = 'w 14–6' |
What is the venue of North Melbourne? | CREATE TABLE table_57473 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Venue" FROM table_57473 WHERE "Home team" = 'north melbourne' |
Questions with a single-use tag that has no tag wiki. These single-use tags are candidates for being deleted by the cleanup script, unless a wiki excerpt is written. Some of these questions might become untagged if the single-use tag deletion script is turned back on. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,Rej... | SELECT TagName, PostId AS "post_link", p.Tags, p.CreationDate FROM Tags AS t LEFT JOIN Posts AS pe ON pe.Id = t.ExcerptPostId LEFT JOIN Posts AS pw ON pw.Id = t.WikiPostId LEFT JOIN PostTags AS pt ON TagId = t.Id LEFT JOIN Posts AS p ON p.Id = PostId WHERE Count = 1 AND (WikiPostId IS NULL OR (LENGTH(pe.Body) < 1 AND L... |
What is Nation, when Rank is greater than 2, when Total is greater than 1, and when Bronze is less than 3? | CREATE TABLE table_77021 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT "Nation" FROM table_77021 WHERE "Rank" > '2' AND "Total" > '1' AND "Bronze" < '3' |
calculate the maximum age of english speaking patients who have sepsis primary disease. | 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 demographic (subject_id text,hadm_id text,name text,marital... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.language = "ENGL" AND demographic.diagnosis = "SEPSIS" |
What was the first series in this list that Jack Orman wrote? | CREATE TABLE table_12564633_1 (series__number INTEGER,written_by VARCHAR) | SELECT MIN(series__number) FROM table_12564633_1 WHERE written_by = "Jack Orman" |
give me the number of patients whose drug name is propofol? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Propofol" |
Which races have points greater than 123, fernando alonso as the driver and a percentage of possible points of 74.44%? | CREATE TABLE table_34089 ("Driver" text,"Points" real,"Season" real,"Races" real,"Percentage of possible points" text) | SELECT "Races" FROM table_34089 WHERE "Points" > '123' AND "Driver" = 'fernando alonso' AND "Percentage of possible points" = '74.44%' |
has patient 009-13409 received a procedure until 4 years ago. | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE cost (costid number,uniquepid text,pati... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-13409')) AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(... |
when was the first time that patient 015-91239 had the maximum value of respiration on the current icu visit? | 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 diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,... | 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 = '015-91239') AND patient.unitdischargetime IS NULL) ... |
Who was the home team when the Tie no was 7? | CREATE TABLE table_name_60 (home_team VARCHAR,tie_no VARCHAR) | SELECT home_team FROM table_name_60 WHERE tie_no = "7" |
Who was the originally artist when Jasmine Murray was selected? | CREATE TABLE table_24426 ("Week #" text,"Theme" text,"Song choice" text,"Original artist" text,"Order #" text,"Result" text) | SELECT "Original artist" FROM table_24426 WHERE "Result" = 'Selected' |
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the average of department_id bin hire_date by time. | 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 jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE departments (DEPARTMENT_ID decima... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
What opponent has tomko (1-1) as a loss? | CREATE TABLE table_name_24 (opponent VARCHAR,loss VARCHAR) | SELECT opponent FROM table_name_24 WHERE loss = "tomko (1-1)" |
Name the 132.1% for where north carolina is colorado | CREATE TABLE table_19826 ("North Carolina" text,"273.7%" text,"South Carolina" text,"132.1%" text,"Mississippi" text,"95.8%" text,"Wisconsin" text,"59.4%" text,"Vermont" text,"32.5%" text) | SELECT "132.1%" FROM table_19826 WHERE "North Carolina" = 'Colorado' |
What is the lowest episode number where john bird was the 4th performer? | CREATE TABLE table_name_48 (episode INTEGER,performer_4 VARCHAR) | SELECT MIN(episode) FROM table_name_48 WHERE performer_4 = "john bird" |
Unanswered questions by deleted users. | CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE Comments (... | SELECT CreationDate, Id AS "post_link" FROM Posts WHERE OwnerUserId IS NULL AND ClosedDate IS NULL AND PostTypeId = 1 AND COALESCE(AnswerCount, 0) = 0 ORDER BY CreationDate |
what are the percentile of 6.7 in a total protein lab test given the same age of patient 030-52327 during their current hospital encounter? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,... | SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'total protein' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '030-52327' AND pat... |
Name the parameter for 2.67 m | CREATE TABLE table_20882 ("Parameter" text,"1st stage" text,"2nd stage" text,"3rd stage" text,"4th stage" text) | SELECT "Parameter" FROM table_20882 WHERE "1st stage" = '2.67 m' |
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 manager_id in a bar chart, and list by the X from low to high. | 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 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),CO... | SELECT JOB_ID, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID |
What is the name of school that has the smallest enrollment in each state? | CREATE TABLE college (cname text,state text,enr number)CREATE TABLE player (pid number,pname text,ycard text,hs number)CREATE TABLE tryout (pid number,cname text,ppos text,decision text) | SELECT cname, state, MIN(enr) FROM college GROUP BY state |
what were the five most frequent lab tests ordered since 2104 for patients in the age of 60 or above? | CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_i... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) AND STRFTIME('%y', labevents.charttime) >=... |
Which School/Club Team has a Round smaller than 5, a Pick larger than 1, and a Player of reggie mckenzie? | CREATE TABLE table_name_97 (school_club_team VARCHAR,player VARCHAR,round VARCHAR,pick VARCHAR) | SELECT school_club_team FROM table_name_97 WHERE round < 5 AND pick > 1 AND player = "reggie mckenzie" |
Name the original title for the last metro | CREATE TABLE table_18987377_1 (original_title VARCHAR,film_title_used_in_nomination VARCHAR) | SELECT original_title FROM table_18987377_1 WHERE film_title_used_in_nomination = "The Last Metro" |
Create a bar chart showing meter_100 across meter 600, and could you order from low to high by the Y-axis? | 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 text)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year... | SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_100 |
Find the distinct first names of all the students who have vice president votes and whose city code is not PIT. | CREATE TABLE STUDENT (Fname VARCHAR,city_code VARCHAR)CREATE TABLE VOTING_RECORD (VICE_PRESIDENT_Vote VARCHAR) | SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_PRESIDENT_Vote EXCEPT SELECT DISTINCT Fname FROM STUDENT WHERE city_code = "PIT" |
Tell me the launch pad for 25 december 2010 10:34 | CREATE TABLE table_31682 ("Flight" text,"Launch date/time (UTC)" text,"Variant" text,"Launch Pad" text,"Payload" text,"Payload Mass" text) | SELECT "Launch Pad" FROM table_31682 WHERE "Launch date/time (UTC)" = '25 december 2010 10:34' |
what are the four most frequent drugs that were prescribed to coronary artery disease female patients 20s within 2 months after they were diagnosed with coronary artery disease in this year? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissio... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'coronary artery disease' AND DATETIME(diagnosis.di... |
what is the diagnosis icd9 and diagnosis long title of subject id 92796? | 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 text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT diagnoses.icd9_code, diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "92796" |
how much does the weight of patient 006-161415 vary last measured on the first hospital visit compared to the second to last value measured on the first hospital visit? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid number,lab... | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-161415' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL O... |
provide the number of patients whose year of death is less than or equal to 2174 and drug code is osel75? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2174.0" AND prescriptions.formulary_drug_cd = "OSEL75" |
What chassis has a year of 1951? | CREATE TABLE table_67243 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real) | SELECT "Chassis" FROM table_67243 WHERE "Year" = '1951' |
patient 004-17866 has received a fio2 lab test in 2105? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage tex... | SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-17866')) AND lab.labname = 'fio2' AND STRFTIME('%y', lab.labresulttime) = '2105' |
how many patients whose admission year is less than 2144 and diagnoses icd9 code is 28802? | 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 text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2144" AND diagnoses.icd9_code = "28802" |
What is the name of the institution with the mascot of blue devils? | CREATE TABLE table_12434380_1 (institution VARCHAR,mascot VARCHAR) | SELECT institution FROM table_12434380_1 WHERE mascot = "Blue Devils" |
how many delegates represented allegany ? | CREATE TABLE table_203_247 (id number,"district" text,"counties represented" text,"delegate" text,"party" text,"first elected" number,"committee" text) | SELECT COUNT("delegate") FROM table_203_247 WHERE "counties represented" = 'allegany' |
What CD has a catalog # of PCR 502? | CREATE TABLE table_name_12 (title VARCHAR,catalog__number VARCHAR) | SELECT title FROM table_name_12 WHERE catalog__number = "pcr 502" |
What was the 2nd Party that had the 2nd Member John Barneby, when the 1st Party was Conservative? | CREATE TABLE table_80170 ("Election" text,"1st Member" text,"1st Party" text,"2nd Member" text,"2nd Party" text) | SELECT "2nd Party" FROM table_80170 WHERE "2nd Member" = 'john barneby' AND "1st Party" = 'conservative' |
what was the maximum monthly number of patients diagnosed with adv eff insulin/antidiab until 2104? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)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_items (row_id number,itemid number... | SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'adv eff insulin/antidiab') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2104' GROUP BY STRFTIME('%y... |
On what date was the record 4 0 0? | CREATE TABLE table_5620 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text) | SELECT "Date" FROM table_5620 WHERE "Record" = '4–0–0' |
What is the date when the city is San Antonio, Texas? | CREATE TABLE table_20996923_20 (date VARCHAR,city VARCHAR) | SELECT date FROM table_20996923_20 WHERE city = "San Antonio, Texas" |
How many races had #99 gainsco/bob stallings racing in round 10? | CREATE TABLE table_19751479_4 (fastest_lap VARCHAR,rnd VARCHAR,pole_position VARCHAR) | SELECT COUNT(fastest_lap) FROM table_19751479_4 WHERE rnd = 10 AND pole_position = "#99 GAINSCO/Bob Stallings Racing" |
Which Cover Model was featured on 8-03? | CREATE TABLE table_name_8 (cover_model VARCHAR,date VARCHAR) | SELECT cover_model FROM table_name_8 WHERE date = "8-03" |
How many starts for an average finish greater than 43? | CREATE TABLE table_76600 ("Year" real,"Starts" real,"Wins" real,"Top 10" real,"Avg. Start" real,"Avg. Finish" real,"Winnings" text,"Position" text) | SELECT SUM("Starts") FROM table_76600 WHERE "Avg. Finish" > '43' |
What is Time, when Round is less than 2, and when Opponent is 'Valentijn Overeem'? | CREATE TABLE table_43630 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Time" FROM table_43630 WHERE "Round" < '2' AND "Opponent" = 'valentijn overeem' |
What is the Season with an Acquisition via of rookie draft, and the number is 15? | CREATE TABLE table_43168 ("Name" text,"Position" text,"Number" text,"School/Club Team" text,"Season" text,"Acquisition via" text) | SELECT "Season" FROM table_43168 WHERE "Acquisition via" = 'rookie draft' AND "Number" = '15' |
Which Constructor won the Roussillon Grand Prix? | CREATE TABLE table_name_95 (winning_constructor VARCHAR,name VARCHAR) | SELECT winning_constructor FROM table_name_95 WHERE name = "roussillon grand prix" |
When the Score was 4-10, what was the Attendance? | CREATE TABLE table_54492 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text) | SELECT "Attendance" FROM table_54492 WHERE "Score" = '4-10' |
What was the To par for the player whose final score was 67-71=138? | CREATE TABLE table_50174 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "To par" FROM table_50174 WHERE "Score" = '67-71=138' |
what is the pick # when the nhl team is montreal canadiens and the college/junior/club team is trois-rivi res draveurs (qmjhl)? | CREATE TABLE table_2679061_2 (pick__number INTEGER,nhl_team VARCHAR,college_junior_club_team VARCHAR) | SELECT MIN(pick__number) FROM table_2679061_2 WHERE nhl_team = "Montreal Canadiens" AND college_junior_club_team = "Trois-Rivières Draveurs (QMJHL)" |
For a team with a goals against less than 58, a position of 10, and a points 2 more than 53, what is the average lost? | CREATE TABLE table_46666 ("Position" real,"Team" text,"Played" real,"Drawn" real,"Lost" real,"Goals For" real,"Goals Against" real,"Goal Average 1" real,"Points 2" real) | SELECT AVG("Lost") FROM table_46666 WHERE "Goals Against" < '58' AND "Position" = '10' AND "Points 2" > '53' |
have a serum creatinine greater than or equal to 1.5 milligrams / deciliter ( mg / dl ) ( male ) or greater than or equal to 1.4 mg / dl ( female ) , or a creatinine clearance less than 60 milliliters / minute ( ml / minute ) | CREATE TABLE table_dev_38 ("id" int,"gender" string,"serum_potassium" float,"systolic_blood_pressure_sbp" int,"creatinine_clearance_cl" float,"estimated_glomerular_filtration_rate_egfr" int,"diastolic_blood_pressure_dbp" int,"ace_inhibitors" bool,"serum_creatinine" float,"kidney_disease" bool,"NOUSE" float) | SELECT * FROM table_dev_38 WHERE (serum_creatinine >= 1.5 AND gender = 'male') OR (serum_creatinine >= 1.4 AND gender = 'female') OR creatinine_clearance_cl < 60 |
What is the score of the home team that played Collingwood? | CREATE TABLE table_51472 ("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_51472 WHERE "Away team" = 'collingwood' |
the most players picked came from which nationality ? | CREATE TABLE table_203_824 (id number,"pick #" number,"player" text,"position" text,"nationality" text,"nhl team" text,"college/junior/club team" text) | SELECT "nationality" FROM table_203_824 GROUP BY "nationality" ORDER BY COUNT("player") DESC LIMIT 1 |
Which films participated in the 30th Hawaii International Film Festival? | CREATE TABLE table_31285 ("Film Festival" text,"Date of ceremony" text,"Category" text,"Participants/Recipients" text,"Result" text) | SELECT "Participants/Recipients" FROM table_31285 WHERE "Film Festival" = '30th Hawaii International Film Festival' |
How much Gold has a Silver smaller than 14, and a Rank larger than 8, and a Bronze of 3? | CREATE TABLE table_9299 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT COUNT("Gold") FROM table_9299 WHERE "Silver" < '14' AND "Rank" > '8' AND "Bronze" = '3' |
What was the rating of the episode Wonder Drug? | CREATE TABLE table_name_82 (ratings__5_capital_cities_ VARCHAR,episode_no VARCHAR) | SELECT ratings__5_capital_cities_ FROM table_name_82 WHERE episode_no = "wonder drug" |
Tell me the eastern #2 for western #2 of oakland | CREATE TABLE table_56898 ("Week" real,"EASTERN #1" text,"Eastern #2" text,"WESTERN #1" text,"Western #2" text) | SELECT "Eastern #2" FROM table_56898 WHERE "Western #2" = 'oakland' |
Who visited on march 26? | CREATE TABLE table_44238 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Attendance" real,"Record" text,"Points" real) | SELECT "Visitor" FROM table_44238 WHERE "Date" = 'march 26' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.