instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
what is the number of patients whose year of birth is less than 2146 and procedure icd9 code is 9755? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2146" AND procedures.icd9_code = "9755" |
What is the roll number of the school with a state authority in Waiotira? | CREATE TABLE table_name_76 (roll VARCHAR,authority VARCHAR,area VARCHAR) | SELECT roll FROM table_name_76 WHERE authority = "state" AND area = "waiotira" |
What is the B (max) average when the C (max) is greater than 156, the taper is 1:19.231, and the D (max) is less than 34.9? | CREATE TABLE table_9637 ("Morse Taper number" real,"Taper" text,"B (max)" real,"C (max)" real,"D (max)" real) | SELECT AVG("B (max)") FROM table_9637 WHERE "C (max)" > '156' AND "Taper" = '1:19.231' AND "D (max)" < '34.9' |
How many deciles have Years of 1 8, and a Roll of 49? | CREATE TABLE table_14986 ("Name" text,"Years" text,"Gender" text,"Area" text,"Authority" text,"Decile" real,"Roll" real) | SELECT COUNT("Decile") FROM table_14986 WHERE "Years" = '1–8' AND "Roll" = '49' |
Show the different headquarters and number of companies at each headquarter with a bar chart, order y axis in ascending order. | CREATE TABLE company (Company_ID real,Name text,Headquarters text,Industry text,Sales_in_Billion real,Profits_in_Billion real,Assets_in_Billion real,Market_Value_in_Billion real)CREATE TABLE people (People_ID int,Age int,Name text,Nationality text,Graduation_College text)CREATE TABLE employment (Company_ID int,People_I... | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY COUNT(*) |
count the numbers of people that have been admitted to the hospital since 5 years ago. | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-5 year') |
Of all the claims, what was the earliest date when any claim was made? | CREATE TABLE Claims (Date_Claim_Made VARCHAR) | SELECT Date_Claim_Made FROM Claims ORDER BY Date_Claim_Made LIMIT 1 |
What was the score of the game when the home team was Lincoln City? | CREATE TABLE table_name_74 (score VARCHAR,home_team VARCHAR) | SELECT score FROM table_name_74 WHERE home_team = "lincoln city" |
What is the least amount of freight carried when the super b capacity reached was February 26? | CREATE TABLE table_17794 ("Year" real,"Road Opened" text,"Road Closed" text,"Freight Carried s Tonne" real,"Super B Capacity Reached [ citation needed ]" text,"Number of Truck Loads North" real) | SELECT MIN("Freight Carried s Tonne") FROM table_17794 WHERE "Super B Capacity Reached [ citation needed ]" = 'February 26' |
what are the different budget type codes, and how many documents are there for each?, I want to list by the total number in desc please. | CREATE TABLE Projects (Project_ID INTEGER,Project_Details VARCHAR(255))CREATE TABLE Ref_Budget_Codes (Budget_Type_Code CHAR(15),Budget_Type_Description VARCHAR(255))CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR(15),Document_Type_Name VARCHAR(255),Document_Type_Description VARCHAR(255))CREATE TABLE Accounts (... | SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code ORDER BY COUNT(*) DESC |
provide the number of patients whose diagnoses icd9 code is 6826 and lab test abnormal status is abnormal? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "6826" AND lab.flag = "abnormal" |
how many patients received mri chest & heart two or more times? | CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name 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)... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'mri chest & heart') G... |
Name the 2013 profit for assets being 11.2 | CREATE TABLE table_26741 ("April 2013 Cum. Rank" real,"Name" text,"Rank 2012" real,"Rank 2013" real,"Base" text,"2013 rev (bil. USD)" text,"2013 Profit (mil. USD)" text,"Assets 2013 (bil.$)" text,"Market cap March 15 (mil.$)" real) | SELECT "2013 Profit (mil. USD )" FROM table_26741 WHERE "Assets 2013 (bil.$)" = '11.2' |
What country are the new orleans shell shockers from? | CREATE TABLE table_28005160_2 (country VARCHAR,sponsored_name VARCHAR) | SELECT country FROM table_28005160_2 WHERE sponsored_name = "New Orleans Shell Shockers" |
For each director, return the director's name together with the title of the movie they directed that received the highest rating among all of their movies, and the value of that rating. Ignore movies whose director is NULL. | CREATE TABLE movie (mid number,title text,year number,director text)CREATE TABLE reviewer (rid number,name text)CREATE TABLE rating (rid number,mid number,stars number,ratingdate time) | SELECT T2.title, T1.stars, T2.director, MAX(T1.stars) FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid WHERE director <> "null" GROUP BY director |
Which Category were Libby Goldstein and Junie Lowry-Johnson recipients and nominees for? | CREATE TABLE table_name_50 (category VARCHAR,recipients_and_nominees VARCHAR) | SELECT category FROM table_name_50 WHERE recipients_and_nominees = "libby goldstein and junie lowry-johnson" |
What is the Total of the Player with a To par of 6 and Year won after 1993? | CREATE TABLE table_64860 ("Player" text,"Country" text,"Year won" real,"Total" real,"To par" real) | SELECT MIN("Total") FROM table_64860 WHERE "Year won" > '1993' AND "To par" = '6' |
Name the least draw for elena dermidjean | CREATE TABLE table_1160 ("Draw" real,"Artist" text,"Song" text,"Televote" real,"Points" real,"Professional Jury" real,"TRM Committee" real,"Total" real,"Place" real) | SELECT MIN("Draw") FROM table_1160 WHERE "Artist" = 'Elena Dermidjean' |
what is the number of patients whose days of hospital stay is greater than 30 and diagnoses long title is contact dermatitis and other eczema, unspecified cause? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "30" AND diagnoses.long_title = "Contact dermatitis and other eczema, unspecified cause" |
What is the result of the game on October 25, 1959 with more than 26,198 fans in attendance? | CREATE TABLE table_39422 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT "Result" FROM table_39422 WHERE "Attendance" > '26,198' AND "Date" = 'october 25, 1959' |
What is the lowest number of games drawn associated with over 39 games played? | CREATE TABLE table_name_39 (drawn INTEGER,played INTEGER) | SELECT MIN(drawn) FROM table_name_39 WHERE played > 39 |
Which pick came from Pittsburgh? | CREATE TABLE table_name_60 (pick VARCHAR,college VARCHAR) | SELECT COUNT(pick) FROM table_name_60 WHERE college = "pittsburgh" |
What was the average attendance on October 30, 1938? | CREATE TABLE table_name_33 (attendance INTEGER,date VARCHAR) | SELECT AVG(attendance) FROM table_name_33 WHERE date = "october 30, 1938" |
What team was the opponent on October 15, 1967? | CREATE TABLE table_48724 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT "Opponent" FROM table_48724 WHERE "Date" = 'october 15, 1967' |
List each donator name and the amount of endowment in descending order of the amount of endowment. Plot them as bar chart. | CREATE TABLE endowment (endowment_id int,School_id int,donator_name text,amount real)CREATE TABLE School (School_id text,School_name text,Location text,Mascot text,Enrollment int,IHSAA_Class text,IHSAA_Football_Class text,County text)CREATE TABLE budget (School_id int,Year int,Budgeted int,total_budget_percent_budgeted... | SELECT donator_name, SUM(amount) FROM endowment GROUP BY donator_name ORDER BY SUM(amount) DESC |
Which school are the Red Devils from? | CREATE TABLE table_name_24 (school VARCHAR,team_name VARCHAR) | SELECT school FROM table_name_24 WHERE team_name = "red devils" |
What is the lowest Subject, when Plural is t der (their)? | CREATE TABLE table_44073 ("Subject" real,"Proximity" text,"Honor" text,"Singular" text,"Plural" text) | SELECT MIN("Subject") FROM table_44073 WHERE "Plural" = 'tãder (their)' |
What tournament was Kirk Triplett a runner-up in? | CREATE TABLE table_47426 ("Date" text,"Tournament" text,"Winning score" text,"Margin of victory" text,"Runner(s)-up" text) | SELECT "Tournament" FROM table_47426 WHERE "Runner(s)-up" = 'kirk triplett' |
What was the share for the episode with the air date december 10, 2008? | CREATE TABLE table_171 ("#" real,"Episode" text,"Air Date" text,"Timeslot (EST)" text,"Rating" text,"Share" text,"18\u201349 Rating" text,"Viewers (millions)" text,"Rank" text) | SELECT "Share" FROM table_171 WHERE "Air Date" = 'December 10, 2008' |
Can you tell me the highest Points that has the Played smaller than 30? | CREATE TABLE table_60855 ("Position" real,"Club" text,"Played" real,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Points" real,"Goal Difference" real) | SELECT MAX("Points") FROM table_60855 WHERE "Played" < '30' |
What is the rank of Point Hyllie? | CREATE TABLE table_name_52 (rank VARCHAR,name VARCHAR) | SELECT rank FROM table_name_52 WHERE name = "point hyllie" |
What was the opponent in the 2008 09 season, with a final score of 2 3 l? | CREATE TABLE table_7997 ("Date" text,"Season" text,"Playing for" text,"Opponent" text,"Final score" text) | SELECT "Opponent" FROM table_7997 WHERE "Season" = '2008–09' AND "Final score" = '2–3 l' |
until 4 years ago, had patient 009-13409 had a procedure? | 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(*) > 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(... |
Which 1992 is the lowest one that has a 1977 smaller than 385577, and a 2011 larger than 340310, and a 2002 larger than 300123, and a 1948 larger than 280524? | CREATE TABLE table_39347 ("County" text,"1948" real,"1956" real,"1966" real,"1977" real,"1992" real,"2002" real,"2011" real) | SELECT MIN("1992") FROM table_39347 WHERE "1977" < '385577' AND "2011" > '340310' AND "2002" > '300123' AND "1948" > '280524' |
What year did Tom Watson win? | CREATE TABLE table_name_78 (year_s__won VARCHAR,player VARCHAR) | SELECT year_s__won FROM table_name_78 WHERE player = "tom watson" |
what's the bubbles with attribute being onpopuphidden | CREATE TABLE table_72647 ("Category" text,"Type" text,"Attribute" text,"Description" text,"Bubbles" text,"Cancelable" text) | SELECT "Bubbles" FROM table_72647 WHERE "Attribute" = 'onpopuphidden' |
Name the sum of year for engine of brm p202 3.0 v12 brm p200 3.0 v12 | CREATE TABLE table_name_43 (year INTEGER,engine_s_ VARCHAR) | SELECT SUM(year) FROM table_name_43 WHERE engine_s_ = "brm p202 3.0 v12 brm p200 3.0 v12" |
What's the lowest division number of the 6th, Great Lakes season? | CREATE TABLE table_1990460_1 (division INTEGER,regular_season VARCHAR) | SELECT MIN(division) FROM table_1990460_1 WHERE regular_season = "6th, Great Lakes" |
Angular vs Ember vs React last Month. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,D... | SELECT rate.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS Rank, rate.Rate AS NumQuestions FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.CreationDate > DATEADD(Month, -1, GETDATE()) AND TagName IN ('angularjs', 'embe... |
Which Size has a County of 62 perry? | CREATE TABLE table_name_69 (size INTEGER,county VARCHAR) | SELECT MAX(size) FROM table_name_69 WHERE county = "62 perry" |
how many athletes were faster than bill chisholm ? | CREATE TABLE table_204_521 (id number,"rank" number,"name" text,"nationality" text,"time (hand)" text,"notes" text) | SELECT COUNT("name") FROM table_204_521 WHERE "time (hand)" < (SELECT "time (hand)" FROM table_204_521 WHERE "name" = 'bill chisholm') |
what is average age of patients whose death status is 0 and primary disease is newborn? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "NEWBORN" |
Bar chart x axis crs code y axis the total number, order names from high to low order. | CREATE TABLE EMPLOYEE (EMP_NUM int,EMP_LNAME varchar(15),EMP_FNAME varchar(12),EMP_INITIAL varchar(1),EMP_JOBCODE varchar(5),EMP_HIREDATE datetime,EMP_DOB datetime)CREATE TABLE PROFESSOR (EMP_NUM int,DEPT_CODE varchar(10),PROF_OFFICE varchar(50),PROF_EXTENSION varchar(4),PROF_HIGH_DEGREE varchar(5))CREATE TABLE CLASS (... | SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE ORDER BY CRS_CODE DESC |
The Eyserweg race was which race #? | CREATE TABLE table_1749567_2 (number INTEGER,name VARCHAR) | SELECT MAX(number) FROM table_1749567_2 WHERE name = "Eyserweg" |
What is the highest RNA segment having a protein of vp2 and a base pair size over 2690? | CREATE TABLE table_35832 ("RNA Segment (Gene)" real,"Size (s base pair)" real,"Protein" text,"Molecular weight kDa" text,"Location" text,"Copies per particle" text) | SELECT MAX("RNA Segment (Gene)") FROM table_35832 WHERE "Protein" = 'vp2' AND "Size ( s base pair )" > '2690' |
What is the nation for 6 total? | CREATE TABLE table_56133 ("Nation" text,"Gold" text,"Silver" text,"Bronze" text,"Total" real) | SELECT "Nation" FROM table_56133 WHERE "Total" = '6' |
What is the name of the Winner in north carolina at the greater greensboro open? | CREATE TABLE table_name_71 (winner VARCHAR,location VARCHAR,tournament VARCHAR) | SELECT winner FROM table_name_71 WHERE location = "north carolina" AND tournament = "greater greensboro open" |
Please show the police forces and the number of counties with each police force. | CREATE TABLE county_public_safety (Police_force VARCHAR) | SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force |
What was the playoff status when the head coach was Brent Sutter, the finish was 4th central, and the points were 82? | CREATE TABLE table_39109 ("Season" text,"Points" text,"Finish" text,"Playoffs" text,"Head Coach" text) | SELECT "Playoffs" FROM table_39109 WHERE "Head Coach" = 'brent sutter' AND "Finish" = '4th central' AND "Points" = '82' |
What is the title of the July 2 song that is downloaded as Crazy Frog? | CREATE TABLE table_name_5 (title VARCHAR,download VARCHAR,issue_date VARCHAR) | SELECT title FROM table_name_5 WHERE download = "crazy frog" AND issue_date = "july 2" |
What was Freddie Starr, who entered on Day 1, known for? | CREATE TABLE table_name_34 (known_for VARCHAR,entered VARCHAR,celebrity VARCHAR) | SELECT known_for FROM table_name_34 WHERE entered = "day 1" AND celebrity = "freddie starr" |
For directors who had more than one movie, bin the year into Year interval and them compute the total number of movies in each year bucket, and group by title The result can be drawn as a trend line, show X-axis in descending order. | CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date) | 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 |
Find the name of customer who has the highest amount of loans. | CREATE TABLE loan (loan_id text,loan_type text,cust_id text,branch_id text,amount number)CREATE TABLE customer (cust_id text,cust_name text,acc_type text,acc_bal number,no_of_loans number,credit_score number,branch_id number,state text)CREATE TABLE bank (branch_id number,bname text,no_of_customers number,city text,stat... | SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY SUM(T2.amount) DESC LIMIT 1 |
can i have a RENTAL CAR in HOUSTON | CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time_zone_code varchar,minimum_connect_time int)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE date_day (month_number int,day_numbe... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'HOUSTON' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'RENTAL CAR' |
in 2105, how many patients underwent therapeutic antibacterials - penicillins during the same hospital encounter after the previous mri - spine? | 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 intakeoutput (intak... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'mri - spine' AND STRFTIME('%y', treatment.treatmenttime) = '2105') AS t1 ... |
count the number of patients that were prescribed cefazolin in the same hospital encounter after having received a stress ulcer prophylaxis - pantoprazole procedure. | 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(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'stress ulcer prophylaxis - pantoprazole') AS t1 JOIN (SELECT patient.uniq... |
how many hours have it been since patient 017-88691 was admitted into the hospital? | 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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '017-88691' AND patient.hospitaldischargetime IS NULL |
Show the average amount of transactions for different lots. | CREATE TABLE Transactions_Lots (lot_id VARCHAR,transaction_id VARCHAR)CREATE TABLE TRANSACTIONS (transaction_id VARCHAR) | SELECT T2.lot_id, AVG(amount_of_transaction) FROM TRANSACTIONS AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id |
What format for the release that had 2000 copies? | CREATE TABLE table_22557 ("Date" real,"Single" text,"Backed with" text,"Record label" text,"Format" text,"Other details" text) | SELECT "Format" FROM table_22557 WHERE "Other details" = '2000 copies' |
What is Country, when Player is 'Billy Maxwell'? | CREATE TABLE table_name_77 (country VARCHAR,player VARCHAR) | SELECT country FROM table_name_77 WHERE player = "billy maxwell" |
What city is 103.3 FM licensed in? | CREATE TABLE table_name_61 (city_of_license VARCHAR,frequency VARCHAR) | SELECT city_of_license FROM table_name_61 WHERE frequency = "103.3 fm" |
Which venue did collingsworth play essendon in when they had the 3rd position on the ladder? | CREATE TABLE table_30911 ("Round" real,"Date" text,"Opponent" text,"Home/Away" text,"Score (Collingwoods score is in bold)" text,"Result (includes margin)" text,"Venue" text,"Position on Ladder" text) | SELECT "Venue" FROM table_30911 WHERE "Opponent" = 'Essendon' AND "Position on Ladder" = '3rd' |
Which regular season had the playoffs of 0 mls cups? | CREATE TABLE table_7714 ("Year" text,"Regular Season" text,"Playoffs" text,"Canadian Championship" text,"CONCACAF Champions League" text) | SELECT "Regular Season" FROM table_7714 WHERE "Playoffs" = '0 mls cups' |
What was the attendance during the week 1 match? | CREATE TABLE table_name_2 (attendance VARCHAR,week VARCHAR) | SELECT attendance FROM table_name_2 WHERE week = 1 |
Which team has a 1:10.998 best? | CREATE TABLE table_name_87 (team VARCHAR,best VARCHAR) | SELECT team FROM table_name_87 WHERE best = "1:10.998" |
Show vote_percent from each date, list by the Vote_Percent in asc please. | CREATE TABLE election (Election_ID int,Representative_ID int,Date text,Votes real,Vote_Percent real,Seats real,Place real)CREATE TABLE representative (Representative_ID int,Name text,State text,Party text,Lifespan text) | SELECT Date, Vote_Percent FROM election ORDER BY Vote_Percent |
What is the least apparent magnitude for all constellations from hydra? | CREATE TABLE table_name_31 (apparent_magnitude INTEGER,constellation VARCHAR) | SELECT MIN(apparent_magnitude) FROM table_name_31 WHERE constellation = "hydra" |
Show all origins and the number of flights from each origin by a bar chart, display by the y axis in descending. | CREATE TABLE flight (flno number(4,0),origin varchar2(20),destination varchar2(20),distance number(6,0),departure_date date,arrival_date date,price number(7,2),aid number(9,0))CREATE TABLE certificate (eid number(9,0),aid number(9,0))CREATE TABLE aircraft (aid number(9,0),name varchar2(30),distance number(6,0))CREATE T... | SELECT origin, COUNT(*) FROM flight GROUP BY origin ORDER BY COUNT(*) DESC |
provide the number of patients whose diagnoses short title is seroma complicting proc and drug route is neb? | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Seroma complicting proc" AND prescriptions.route = "NEB" |
Which Episode title has a Episode # of s2? | CREATE TABLE table_9773 ("Episode #" text,"Original airdate (UK)" text,"Episode title" text,"Doctor Who episode" text,"Webcast link" text) | SELECT "Episode title" FROM table_9773 WHERE "Episode #" = 's2' |
how many patients were admitted before the year 2165 with the diagnosis icd9 code v1083? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2165" AND diagnoses.icd9_code = "V1083" |
In the match where north melbourne was the away team, how much did the home team score? | CREATE TABLE table_77789 ("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_77789 WHERE "Away team" = 'north melbourne' |
Which Total matches is the lowest one that has a Total W-L-H of 1-2-0? | CREATE TABLE table_5980 ("Year" text,"Total matches" real,"Total W-L-H" text,"Singles W-L-H" text,"Points won" real,"Points %" text) | SELECT MIN("Total matches") FROM table_5980 WHERE "Total W-L-H" = '1-2-0' |
Tell me japan for jigsaw land: japan graffiti | CREATE TABLE table_name_14 (japan VARCHAR,title VARCHAR) | SELECT japan FROM table_name_14 WHERE title = "jigsaw land: japan graffiti" |
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the sum of code , and group by attribute name, could you list by the y axis in desc? | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code DESC |
What are the goals for 8/4/04? | CREATE TABLE table_56163 ("Date" text,"Competition" text,"Venue" text,"Result" text,"Score" text,"Goals" text) | SELECT "Goals" FROM table_56163 WHERE "Date" = '8/4/04' |
What are the states with the most invoices? | CREATE TABLE media_types (id number,name text)CREATE TABLE invoices (id number,customer_id number,invoice_date time,billing_address text,billing_city text,billing_state text,billing_country text,billing_postal_code text,total number)CREATE TABLE invoice_lines (id number,invoice_id number,track_id number,unit_price numb... | SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1 |
What gender is Quentin? | CREATE TABLE table_2933761_1 (gender VARCHAR,name VARCHAR) | SELECT gender FROM table_2933761_1 WHERE name = "Quentin" |
What is Height, when Name is 'Manuela Zanchi'? | CREATE TABLE table_62343 ("Name" text,"Pos." text,"Height" text,"Weight" text,"Date of Birth" text,"Club" text) | SELECT "Height" FROM table_62343 WHERE "Name" = 'manuela zanchi' |
pregnant or planning to become pregnant within 6 months | CREATE TABLE table_train_187 ("id" int,"pregnancy_or_lactation" bool,"renal_disease" bool,"diabetic" string,"liver_disease" bool,"NOUSE" float) | SELECT * FROM table_train_187 WHERE pregnancy_or_lactation = 1 |
which player is in the last position ? | CREATE TABLE table_204_355 (id number,"#" text,"player" text,"country" text,"score" text,"to par" number,"money ($)" number) | SELECT "player" FROM table_204_355 ORDER BY id DESC LIMIT 1 |
What is Lost, when Losing Bonus is '3', and when Club is 'Bettws RFC'? | CREATE TABLE table_47000 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text) | SELECT "Lost" FROM table_47000 WHERE "Losing bonus" = '3' AND "Club" = 'bettws rfc' |
what is the last competition listed on the table ? | CREATE TABLE table_203_5 (id number,"season" text,"competition" text,"round" text,"opponent" text,"home" text,"away" text,"aggregate" text) | SELECT "competition" FROM table_203_5 ORDER BY id DESC LIMIT 1 |
how many times does patient 20165 receive a nutren pulmonary intake until 1729 days ago? | CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE chartevents (row_id number,subject_... | SELECT COUNT(*) 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 = 20165)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'nutren pulmo... |
what was the name of the only business simulation video game developed by frog city ? | CREATE TABLE table_204_121 (id number,"year" text,"game" text,"developer" text,"setting" text,"platform" text,"notes" text) | SELECT "game" FROM table_204_121 WHERE "developer" = 'frog city' |
What is the transfer fee for the MLI player with fewer than 63 goals in a year more recent than 2006? | CREATE TABLE table_49405 ("Nat." text,"Name" text,"Since" text,"Goals" real,"Ends" text,"Transfer fee" text) | SELECT "Transfer fee" FROM table_49405 WHERE "Since" = '2006' AND "Goals" < '63' AND "Nat." = 'mli' |
what airlines fly from BOSTON to ATLANTA | CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE ground_service (ci... | SELECT DISTINCT airline.airline_code FROM airline, 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_na... |
during this year, how many patients were prescribed sodium citrate/citric acid? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)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 icustays (row_id number,subject_id number,hadm_id nu... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'sodium citrate/citric acid' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) |
What player plays for the Dakota Wizards? | CREATE TABLE table_name_73 (player VARCHAR,team VARCHAR) | SELECT player FROM table_name_73 WHERE team = "dakota wizards" |
What is the opponent name when the H/A is h with more than 28,411 in attendance and Sharpe 28' is the scorer? | CREATE TABLE table_76876 ("Date" text,"Round" text,"Opponents" text,"H / A" text,"Result F \u2013 A" text,"Scorers" text,"Attendance" real) | SELECT "Opponents" FROM table_76876 WHERE "H / A" = 'h' AND "Attendance" > '28,411' AND "Scorers" = 'sharpe 28' |
What is the total number of played values for teams with more than 14 points and more than 1 draw? | CREATE TABLE table_name_84 (played VARCHAR,points VARCHAR,drawn VARCHAR) | SELECT COUNT(played) FROM table_name_84 WHERE points > 14 AND drawn > 1 |
Tell me the number of regions with an area of 58.81 | CREATE TABLE table_name_76 (region VARCHAR,area__km_2__ VARCHAR) | SELECT COUNT(region) FROM table_name_76 WHERE area__km_2__ = 58.81 |
What are the course names, ordered by credits? | CREATE TABLE faculty (facid number,lname text,fname text,rank text,sex text,phone number,room text,building text)CREATE TABLE gradeconversion (lettergrade text,gradepoint number)CREATE TABLE enrolled_in (stuid number,cid text,grade text)CREATE TABLE department (dno number,division text,dname text,room text,building tex... | SELECT cname FROM course ORDER BY credits |
heartrate for patient 029-6419 measured at 2102-12-02 05:46:06 is less than the value measured at 2102-12-02 05:41:06? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature ... | SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-6419')) AND NOT vitalperiodic.heartrate IS NU... |
Plot the average of budget in billions over creation in a line chart, and order by the x-axis from low to high. | CREATE TABLE management (department_ID int,head_ID int,temporary_acting text)CREATE TABLE head (head_ID int,name text,born_state text,age real)CREATE TABLE department (Department_ID int,Name text,Creation text,Ranking int,Budget_in_Billions real,Num_Employees real) | SELECT Creation, AVG(Budget_in_Billions) FROM department GROUP BY Creation ORDER BY Creation |
a random plasma glucose of 200 mg / dl or more with typical symptom of diabetes | CREATE TABLE table_train_198 ("id" int,"hemoglobin_a1c_hba1c" float,"fasting_plasma_glucose" int,"diabetes" bool,"body_mass_index_bmi" float,"type_1_patients" bool,"NOUSE" float) | SELECT * FROM table_train_198 WHERE fasting_plasma_glucose >= 200 OR diabetes = 1 |
Which 1947 Nos has a BR Nos of 48730-9? | CREATE TABLE table_name_55 (br_nos VARCHAR) | SELECT 1947 AS _nos FROM table_name_55 WHERE br_nos = "48730-9" |
What is the rank when the time is 6:50.48? | CREATE TABLE table_name_70 (rank VARCHAR,time VARCHAR) | SELECT rank FROM table_name_70 WHERE time = "6:50.48" |
What attendance has astros as the opponent, and april 29 as the date? | CREATE TABLE table_name_69 (attendance INTEGER,opponent VARCHAR,date VARCHAR) | SELECT SUM(attendance) FROM table_name_69 WHERE opponent = "astros" AND date = "april 29" |
What date is associated with the Loss of Farrell (6-13)? | CREATE TABLE table_38429 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text) | SELECT "Date" FROM table_38429 WHERE "Loss" = 'farrell (6-13)' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.