instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Stack bar chart of the number of type vs Nationality based on type, and list x-axis in descending order. | CREATE TABLE ship (Ship_ID int,Name text,Type text,Nationality text,Tonnage int)CREATE TABLE mission (Mission_ID int,Ship_ID int,Code text,Launched_Year int,Location text,Speed_knots int,Fate text) | SELECT Type, COUNT(Type) FROM ship GROUP BY Nationality, Type ORDER BY Type DESC |
how many days have passed since patient 007-15837 had a d5w intake for the first time on the current intensive care unit 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 intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text... | SELECT 1 * (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 =... |
In how many teams is Waqar Younis the head coach? | CREATE TABLE table_23425 ("Team" text,"Province" text,"Owner(s)" text,"Price" text,"Captain" text,"Head coach" text,"Icon Player" text) | SELECT COUNT("Team") FROM table_23425 WHERE "Head coach" = 'Waqar Younis' |
What is the locomotive class that has a wheel arrangement of 2-8-2 and a quantity made of 25? | CREATE TABLE table_name_48 (class VARCHAR,wheel_arrangement VARCHAR,quantity_made VARCHAR) | SELECT class FROM table_name_48 WHERE wheel_arrangement = "2-8-2" AND quantity_made = "25" |
What is the Score, when the Year is after 2007, and when the Country is England? | CREATE TABLE table_name_5 (score VARCHAR,year VARCHAR,country VARCHAR) | SELECT score FROM table_name_5 WHERE year > 2007 AND country = "england" |
What is the Country of the Player with a Score of 75-70-74=219? | CREATE TABLE table_8723 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Country" FROM table_8723 WHERE "Score" = '75-70-74=219' |
Name the cost for latest stable date of online | CREATE TABLE table_name_48 (cost___usd__ VARCHAR,latest_stable_date__version_ VARCHAR) | SELECT cost___usd__ FROM table_name_48 WHERE latest_stable_date__version_ = "online" |
What is the oppenent when the score was 5 0? | CREATE TABLE table_name_70 (opponent VARCHAR,score VARCHAR) | SELECT opponent FROM table_name_70 WHERE score = "5–0" |
count the number of patients whose ethnicity is white - russian and admission year is less than 2150? | 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 WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.admityear < "2150" |
what 's the difference between adam cole 's first run and his second run ? | CREATE TABLE table_203_358 (id number,"pos." number,"athlete" text,"run 1" number,"run 2" number,"total" text) | SELECT ABS((SELECT "run 1" FROM table_203_358 WHERE "athlete" = 'adam cole') - (SELECT "run 2" FROM table_203_358 WHERE "athlete" = 'adam cole')) |
How many seasons was the losing team Adelaide City? | CREATE TABLE table_12028543_3 (season VARCHAR,losingteam VARCHAR) | SELECT COUNT(season) FROM table_12028543_3 WHERE losingteam = "Adelaide City" |
What venue had less than 2 goals? | CREATE TABLE table_name_80 (venue VARCHAR,goal INTEGER) | SELECT venue FROM table_name_80 WHERE goal < 2 |
List the names of all distinct wines in alphabetical order. | CREATE TABLE WINE (Name VARCHAR) | SELECT DISTINCT Name FROM WINE ORDER BY Name |
What is the average number of wins for events larger than 28? | CREATE TABLE table_name_22 (wins INTEGER,events INTEGER) | SELECT AVG(wins) FROM table_name_22 WHERE events > 28 |
Name the surface for cara black rennae stubbs | CREATE TABLE table_23944006_4 (surface VARCHAR,opponents VARCHAR) | SELECT surface FROM table_23944006_4 WHERE opponents = "Cara Black Rennae Stubbs" |
how many total players played ? | CREATE TABLE table_203_251 (id number,"place" text,"player" text,"country" text,"score" text,"to par" number) | SELECT COUNT("player") FROM table_203_251 |
What is the enrollment for the school in bottineau? | CREATE TABLE table_2076522_2 (enrollment__fall_2010_ VARCHAR,location_s_ VARCHAR) | SELECT enrollment__fall_2010_ FROM table_2076522_2 WHERE location_s_ = "Bottineau" |
among patients who were prescribed cefazolin 2 gm in ns 100 ml ivpb after they had been diagnosed with esophageal ca show me the five year survival rate. | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid num... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... |
What is the score on 23 November 1983 with exeter city as the away team? | CREATE TABLE table_name_31 (score VARCHAR,date VARCHAR,away_team VARCHAR) | SELECT score FROM table_name_31 WHERE date = "23 november 1983" AND away_team = "exeter city" |
What is the points where Toronto was the home team and the game number was larger than 63? | CREATE TABLE table_55713 ("Game #" real,"Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text,"Points" real) | SELECT MAX("Points") FROM table_55713 WHERE "Home" = 'toronto' AND "Game #" > '63' |
what's the mole with prize money being 24,475 | CREATE TABLE table_17949 ("Season" text,"Airdate" text,"The Mole" text,"Winner" text,"Runner-up" text,"Prize money" text,"International destination" text) | SELECT "The Mole" FROM table_17949 WHERE "Prize money" = '€24,475' |
What is the i/o bus for the brand name Core i3-21xx? | CREATE TABLE table_26907 ("Codename (main article)" text,"Brand name (list)" text,"Cores" real,"L3 Cache" text,"Socket" text,"TDP" text,"I/O Bus" text) | SELECT "I/O Bus" FROM table_26907 WHERE "Brand name (list)" = 'Core i3-21xx' |
What are the product ids for the problems reported by Christop Berge with closure authorised by Ashley Medhurst? | CREATE TABLE product (product_id number,product_name text,product_details text)CREATE TABLE problems (problem_id number,product_id number,closure_authorised_by_staff_id number,reported_by_staff_id number,date_problem_reported time,date_problem_closed time,problem_description text,other_problem_details text)CREATE TABLE... | SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Christop" AND T2.staff_last_name = "Berge" INTERSECT SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Ashley"... |
What is the Sum of ERP W, when Call Sign is K216GA? | CREATE TABLE table_77228 ("Call sign" text,"Frequency MHz" real,"City of license" text,"ERP W" real,"Class" text,"FCC info" text) | SELECT SUM("ERP W") FROM table_77228 WHERE "Call sign" = 'k216ga' |
For the 27 arrow match event, what's the sum of all scores for that event? | CREATE TABLE table_45015 ("Event" text,"Score" real,"Name" text,"Nation" text,"Games" text,"Date" text) | SELECT SUM("Score") FROM table_45015 WHERE "Event" = '27 arrow match' |
What was the number of murders the year forcible rapes were at 166? | CREATE TABLE table_27498 ("Year" real,"Population" real,"Index" real,"Violent" real,"Property" real,"Murder" real,"Forcible rape" real,"Robbery" real,"Aggravated assault" real,"Burglary" real,"Larceny Theft" real,"Vehicle Theft" real) | SELECT "Murder" FROM table_27498 WHERE "Forcible rape" = '166' |
when was the first microbiology test of patient 031-22988, until 16 months ago? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,... | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988')) AND DATETIME(microlab.culturetakentime) <= DATETIME(... |
What was the top score for grier jones? | CREATE TABLE table_name_59 (score INTEGER,player VARCHAR) | SELECT MAX(score) FROM table_name_59 WHERE player = "grier jones" |
Questions on a specific date. | CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId nu... | SELECT * FROM Posts WHERE CreationDate = '##PostDate##' LIMIT 10 |
What are the first and last names of the 5 customers who purchased something most recently? | CREATE TABLE customers (id number,first_name text,last_name text,company text,address text,city text,state text,country text,postal_code text,phone text,fax text,email text,support_rep_id number)CREATE TABLE genres (id number,name text)CREATE TABLE employees (id number,last_name text,first_name text,title text,reports_... | SELECT T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5 |
Who was the opponent on May 20? | CREATE TABLE table_name_74 (opponent VARCHAR,date VARCHAR) | SELECT opponent FROM table_name_74 WHERE date = "may 20" |
how many patients whose admission location is trsf within this facility and days of hospital stay is greater than 30? | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.days_stay > "30" |
What is Brian Gay's place? | CREATE TABLE table_name_77 (place VARCHAR,player VARCHAR) | SELECT place FROM table_name_77 WHERE player = "brian gay" |
what is the title when the release date is 1938-12-17 and the production number is 8610? | CREATE TABLE table_66198 ("Title" text,"Series" text,"Director" text,"Production Num." text,"Release date" text) | SELECT "Title" FROM table_66198 WHERE "Release date" = '1938-12-17' AND "Production Num." = '8610' |
What was the score of the game against the San Diego Chargers? | CREATE TABLE table_name_41 (score VARCHAR,opponent VARCHAR) | SELECT score FROM table_name_41 WHERE opponent = "san diego chargers" |
Draw a pie chart about the proportion of All_Road and Team_ID. | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce... | SELECT All_Road, Team_ID FROM basketball_match |
Calculate the minimum age of patients admitted to emergency on the same day | 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 MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.days_stay = "0" |
What was the away team at the match where the crowd was larger than 30,000? | CREATE TABLE table_name_3 (away_team VARCHAR,crowd INTEGER) | SELECT away_team FROM table_name_3 WHERE crowd > 30 OFFSET 000 |
What is the age of the act who is a rapper? | CREATE TABLE table_29574 ("Name/Name of Act" text,"Age(s)" text,"Genre" text,"Act" text,"Hometown" text,"Qtr. Final (Week)" real,"Semi Final (Week)" text,"Position Reached" text) | SELECT "Age(s)" FROM table_29574 WHERE "Act" = 'Rapper' |
Plot the number of payment method code by grouped by payment method code as a bar graph | CREATE TABLE Settlements (Settlement_ID INTEGER,Claim_ID INTEGER,Date_Claim_Made DATE,Date_Claim_Settled DATE,Amount_Claimed INTEGER,Amount_Settled INTEGER,Customer_Policy_ID INTEGER)CREATE TABLE Claims (Claim_ID INTEGER,Policy_ID INTEGER,Date_Claim_Made DATE,Date_Claim_Settled DATE,Amount_Claimed INTEGER,Amount_Settle... | SELECT Payment_Method_Code, COUNT(Payment_Method_Code) FROM Payments GROUP BY Payment_Method_Code |
what stadium can hold no more than 2500 people ? | CREATE TABLE table_204_567 (id number,"team" text,"location" text,"stadium" text,"capacity" number,"manager" text,"captain" text,"kit manufacturer" text,"shirt sponsor" text) | SELECT "stadium" FROM table_204_567 WHERE "capacity" <= 2500 |
Users by number of tag edits. | CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE Rev... | SELECT UserId AS "user_link", COUNT(Id) FROM PostHistory WHERE PostHistoryTypeId = 6 GROUP BY UserId ORDER BY COUNT(Id) DESC |
how many male patients had the diagnosis long title microscopic hematuria? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Microscopic hematuria" |
Show me a scatter plot of people id and total for . | CREATE TABLE people (People_ID int,Name text,Height real,Weight real,Birth_Date text,Birth_Place text)CREATE TABLE body_builder (Body_Builder_ID int,People_ID int,Snatch real,Clean_Jerk real,Total real) | SELECT People_ID, Total FROM body_builder |
Which episode had Lavern Baker? | CREATE TABLE table_28480 ("Episode" text,"Theme" text,"Song choice" text,"Original recording artist" text,"Order #" text,"Result" text) | SELECT "Episode" FROM table_28480 WHERE "Original recording artist" = 'LaVern Baker' |
how many more titles did team maccabi tel aviv win than every other team combined ? | CREATE TABLE table_204_129 (id number,"place" number,"team" text,"titles" number,"runners-up" number,"winning years" text) | SELECT (SELECT "titles" FROM table_204_129 WHERE "team" = 'maccabi tel aviv') - (SELECT SUM("titles") FROM table_204_129 WHERE "team" <> 'maccabi tel aviv') |
Name the number of song for scoreboard being 3rd | CREATE TABLE table_24210 ("Order" real,"Couple" text,"Karen" text,"Nicky" text,"Jason" text,"Ruthie" text,"Robin" text,"Total" text,"Scoreboard" text,"Song" text,"Public Vote %" text,"Result" text) | SELECT COUNT("Song") FROM table_24210 WHERE "Scoreboard" = '3rd' |
When was the 'first season of current spell in top division' if the first season in top division is in 1964-65? | CREATE TABLE table_18143210_2 (first_season_of_current_spell_in_top_division VARCHAR,first_season_in_top_division VARCHAR) | SELECT first_season_of_current_spell_in_top_division FROM table_18143210_2 WHERE first_season_in_top_division = "1964-65" |
Which Wrestler plays for Team Batista which was Elimated by Orton on Elimination 8? | CREATE TABLE table_79064 ("Elimination" text,"Wrestler" text,"Team" text,"Eliminated by" text,"Elimination Move" text,"Time" text) | SELECT "Wrestler" FROM table_79064 WHERE "Team" = 'team batista' AND "Eliminated by" = 'orton' AND "Elimination" = '8' |
Which Venue has a Year of 1911? | CREATE TABLE table_5765 ("Opposition" text,"Score" text,"Venue" text,"City" text,"Year" real) | SELECT "Venue" FROM table_5765 WHERE "Year" = '1911' |
How many total show when silver is 0, bronze is 1, and the rank is less than 3? | CREATE TABLE table_name_73 (total VARCHAR,rank VARCHAR,silver VARCHAR,bronze VARCHAR) | SELECT COUNT(total) FROM table_name_73 WHERE silver = 0 AND bronze = 1 AND rank < 3 |
What was the record when the TKO (elbows) method was used? | CREATE TABLE table_name_12 (record VARCHAR,method VARCHAR) | SELECT record FROM table_name_12 WHERE method = "tko (elbows)" |
When the Per capita income is $29,194, what is the average population? | CREATE TABLE table_5677 ("County" text,"Per capita income" text,"Median household income" text,"Median family income" text,"Population" real,"Number of households" real) | SELECT AVG("Population") FROM table_5677 WHERE "Per capita income" = '$29,194' |
tell me the price of a procedure called insert infusion pump? | CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABL... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'procedures_icd' AND cost.event_id IN (SELECT procedures_icd.row_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'insert infusion pump')) |
give me the number of patients whose age is less than 85 and diagnoses icd9 code is 53541? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "85" AND diagnoses.icd9_code = "53541" |
What was the issue date for the song by Paul Mccartney and Michael Jackson? | CREATE TABLE table_42360 ("Volume:Issue" text,"Issue Date(s)" text,"Weeks on Top" real,"Song" text,"Artist" text) | SELECT "Issue Date(s)" FROM table_42360 WHERE "Artist" = 'paul mccartney and michael jackson' |
What is the Airline when the notes show aoc 135? | CREATE TABLE table_name_51 (airline VARCHAR,notes VARCHAR) | SELECT airline FROM table_name_51 WHERE notes = "aoc 135" |
What day was the visitor Chicago Black Hawks and the record 0-2? | CREATE TABLE table_name_16 (date VARCHAR,visitor VARCHAR,record VARCHAR) | SELECT date FROM table_name_16 WHERE visitor = "chicago black hawks" AND record = "0-2" |
how many games were scheduled between september 3rd and january 2nd ? | CREATE TABLE table_204_55 (id number,"date" text,"time" text,"opponent#" text,"rank#" text,"site" text,"tv" text,"result" text,"attendance" number) | SELECT COUNT(*) FROM table_204_55 |
What is the authority status of the school in Ellerslie with a decile of 7? | CREATE TABLE table_52270 ("Name" text,"Years" text,"Area" text,"Authority" text,"Decile" text,"Roll" real) | SELECT "Authority" FROM table_52270 WHERE "Area" = 'ellerslie' AND "Decile" = '7' |
What is the lifespan of Joseph Vance, a democratic-republican from Ohio? | CREATE TABLE table_80169 ("Representative" text,"Years" text,"State" text,"Party" text,"Lifespan" text) | SELECT "Lifespan" FROM table_80169 WHERE "State" = 'ohio' AND "Representative" = 'joseph vance' AND "Party" = 'democratic-republican' |
zero voted answers to total answers. | CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE CloseAsOffTopicReasonTyp... | SELECT CAST(a.zero_voted_answers * 100.0 AS FLOAT) / a.total_answers AS percentage FROM (SELECT COUNT(*) AS total_answers, COUNT(CASE WHEN Score = 0 THEN 1 ELSE NULL END) AS zero_voted_answers FROM Posts WHERE OwnerUserId = '##UserId##' AND PostTypeId = 2) AS a |
Which number is ? | CREATE TABLE table_name_69 (standard_order VARCHAR,traditional_chinese VARCHAR) | SELECT standard_order FROM table_name_69 WHERE traditional_chinese = "國殤" |
List the major of each male student. | CREATE TABLE voting_record (stuid number,registration_date text,election_cycle text,president_vote number,vice_president_vote number,secretary_vote number,treasurer_vote number,class_president_vote number,class_senator_vote number)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number... | SELECT major FROM student WHERE sex = "M" |
List the states which have between 2 to 4 staffs living there. | CREATE TABLE staff (staff_id number,staff_address_id number,nickname text,first_name text,middle_name text,last_name text,date_of_birth time,date_joined_staff time,date_left_staff time)CREATE TABLE addresses (address_id number,line_1_number_building text,city text,zip_postcode text,state_province_county text,country te... | SELECT T1.state_province_county FROM addresses AS T1 JOIN staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING COUNT(*) BETWEEN 2 AND 4 |
What team did Johnson (11-7) play for? | CREATE TABLE table_68885 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text) | SELECT "Opponent" FROM table_68885 WHERE "Loss" = 'johnson (11-7)' |
Which 2002 has a 2009 of 2r? | CREATE TABLE table_name_96 (Id VARCHAR) | SELECT 2002 FROM table_name_96 WHERE 2009 = "2r" |
provide the number of patients whose diagnoses short title is seroma complicting proc and lab test category is hematology? | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Seroma complicting proc" AND lab."CATEGORY" = "Hematology" |
Which clubs have one or more members from the city with code 'HOU'? Give me the names of the clubs. | CREATE TABLE club (clubid number,clubname text,clubdesc text,clublocation text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE member_of_club (stuid number,clubid number,position text) | SELECT DISTINCT t1.clubname 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 t3.city_code = "HOU" |
What's the heigh of the player who went to lake howell high school? | CREATE TABLE table_53572 ("Player" text,"Height" text,"School" text,"Hometown" text,"College" text) | SELECT "Height" FROM table_53572 WHERE "School" = 'lake howell high school' |
What 2003 rank does the airport IATA code SIN have? | CREATE TABLE table_35254 ("Rank" real,"Airport" text,"Location" text,"Code (IATA)" text,"Total Cargo (Metric Tonnes)" text,"2003 Rank" text,"% Change" text) | SELECT "2003 Rank" FROM table_35254 WHERE "Code (IATA)" = 'sin' |
What rank did the chassis reynard 94i have in 1996? | CREATE TABLE table_80274 ("Year" text,"Team" text,"Chassis" text,"Engine" text,"Rank" text) | SELECT "Rank" FROM table_80274 WHERE "Chassis" = 'reynard 94i' AND "Year" = '1996' |
indicate the yearly average volume of urine that patient 018-81471 has had since 1751 days ago. | 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 AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-81471')) AND intakeoutput.celllabel = 'urine... |
What is the highest number of games with more than 0 draws and 11 losses? | CREATE TABLE table_47038 ("Name" text,"Period" text,"Games" real,"Wins" real,"Draws" real,"Lost" real,"Win Ratio" text) | SELECT MAX("Games") FROM table_47038 WHERE "Draws" > '0' AND "Lost" = '11' |
WHAT COUNTRY HAS A TO PAR OF +1, WITH WOODY AUSTIN? | CREATE TABLE table_name_68 (country VARCHAR,to_par VARCHAR,player VARCHAR) | SELECT country FROM table_name_68 WHERE to_par = "+1" AND player = "woody austin" |
what were the three most frequent drugs that were prescribed to hypoxemia - due to hypercarbia male patients in the 30s in the same month after being diagnosed with hypoxemia - due to hypercarbia until 3 years ago? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst... | 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 = 'hypoxemia - due to hypercarbia' AND DATETIME(diagn... |
Which college has any student who is a goalie and succeeded in the tryout. | CREATE TABLE tryout (cName VARCHAR,decision VARCHAR,pPos VARCHAR) | SELECT cName FROM tryout WHERE decision = 'yes' AND pPos = 'goalie' |
What are the distinct nominees of the musicals with the award that is not 'Tony Award'? | CREATE TABLE actor (actor_id number,name text,musical_id number,character text,duration text,age number)CREATE TABLE musical (musical_id number,name text,year number,award text,category text,nominee text,result text) | SELECT DISTINCT nominee FROM musical WHERE award <> "Tony Award" |
compared to second measured on the current icu visit is the sao2 of patient 3125 greater than the value first measured on the current icu visit? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)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 inputevents_cv (row_id number,s... | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3125) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_it... |
Name the Team which has Points larger than 9, and a Year larger than 1971, and a Class of 250cc? | CREATE TABLE table_name_12 (team VARCHAR,class VARCHAR,points VARCHAR,year VARCHAR) | SELECT team FROM table_name_12 WHERE points > 9 AND year > 1971 AND class = "250cc" |
What time is associated with the event that happened in Tokyo, Japan, ending in a draw, with 3 rounds? | CREATE TABLE table_name_44 (time VARCHAR,res VARCHAR,location VARCHAR,round VARCHAR) | SELECT time FROM table_name_44 WHERE location = "tokyo, japan" AND round = 3 AND res = "draw" |
Who has a mark of 6.17 in group B? | CREATE TABLE table_64537 ("Rank" text,"Group" text,"Name" text,"Nationality" text,"Mark" text) | SELECT "Name" FROM table_64537 WHERE "Group" = 'b' AND "Mark" = '6.17' |
What is the % similarity to C7orf38 of the animal whose % identity to C7orf38 is 81? | CREATE TABLE table_26957063_3 (_percentage_similarity_to_c7orf38 INTEGER,_percentage_identity_to_c7orf38 VARCHAR) | SELECT MAX(_percentage_similarity_to_c7orf38) FROM table_26957063_3 WHERE _percentage_identity_to_c7orf38 = 81 |
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the sum of manager_id bin hire_date by weekday in a bar chart, could you order y-axis in asc 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 jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME var... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(MANAGER_ID) |
get me the number of patients on base type drug prescription who have diagnoses icd9 code 78321. | 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 lab (subject_id text,hadm_id text,itemid text,charttime te... | 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.icd9_code = "78321" AND prescriptions.drug_type = "BASE" |
Which Championship has a Score of 2 6, 4 6, 4 6? | CREATE TABLE table_name_91 (championship VARCHAR,score VARCHAR) | SELECT championship FROM table_name_91 WHERE score = "2–6, 4–6, 4–6" |
Who was the opponent with the loss in Westbury, NY? | CREATE TABLE table_name_37 (opponent VARCHAR,result VARCHAR,location VARCHAR) | SELECT opponent FROM table_name_37 WHERE result = "loss" AND location = "westbury, ny" |
Find the number of classes offered for all class rooms that held at least 2 classes Show bar chart, rank from high to low by the Y. | CREATE TABLE DEPARTMENT (DEPT_CODE varchar(10),DEPT_NAME varchar(30),SCHOOL_CODE varchar(8),EMP_NUM int,DEPT_ADDRESS varchar(20),DEPT_EXTENSION varchar(4))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)C... | SELECT CLASS_ROOM, COUNT(*) FROM CLASS GROUP BY CLASS_ROOM ORDER BY COUNT(*) DESC |
What is the location with the most cinemas opened in year 2010 or later? | CREATE TABLE cinema (LOCATION VARCHAR,openning_year VARCHAR) | SELECT LOCATION FROM cinema WHERE openning_year >= 2010 GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1 |
Who was the champion of JD Motorsport after 2005? | CREATE TABLE table_55690 ("Season" real,"Series Name" text,"Champion" text,"Team Champion" text,"Secondary Class Champion" text) | SELECT "Champion" FROM table_55690 WHERE "Season" > '2005' AND "Team Champion" = 'jd motorsport' |
Name the period for Chart of g-music j-pop/k-pop chart | CREATE TABLE table_name_29 (period VARCHAR,chart VARCHAR) | SELECT period FROM table_name_29 WHERE chart = "g-music j-pop/k-pop chart" |
What is the Position with a round 3 pick for r. jay soward? | CREATE TABLE table_name_20 (position VARCHAR,round VARCHAR,name VARCHAR) | SELECT position FROM table_name_20 WHERE round < 3 AND name = "r. jay soward" |
What is the Dialcode of whitechapel? | CREATE TABLE table_name_62 (dialcode VARCHAR,location VARCHAR) | SELECT dialcode FROM table_name_62 WHERE location = "whitechapel" |
how much changes in the weight of patient 006-181433 last measured on the current hospital visit compared to the first value measured on the current hospital 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 treatment (treatmentid number,patientunitstayid number,treatmentname text,... | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-181433' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1) - (... |
How many nations do the FMS international team represent? | CREATE TABLE table_2027 ("Name" text,"Nation" text,"Seasons" text,"Championship Titles" text,"Race Starts" real,"Poles" real,"Wins" real,"Podiums" real,"Fastest Laps" real) | SELECT COUNT("Nation") FROM table_2027 WHERE "Name" = 'FMS International' |
what is the four year survival probability for the patients diagnosed with hyponatremia - due to adrenal insufficiency? | 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 SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI... |
What is the total number of points of the honda hr-1 engine? | CREATE TABLE table_75940 ("Year" real,"Team" text,"Chassis" text,"Engine" text,"Rank" text,"Points" real) | SELECT COUNT("Points") FROM table_75940 WHERE "Engine" = 'honda hr-1' |
what is the highest grid when the laps is less than 44 and the constructor is renault? | CREATE TABLE table_name_10 (grid INTEGER,laps VARCHAR,constructor VARCHAR) | SELECT MAX(grid) FROM table_name_10 WHERE laps < 44 AND constructor = "renault" |
what is the episode number where the total viewers is 614000? | CREATE TABLE table_17905 ("Series number" text,"Episode number" real,"Date of first broadcast" text,"Total viewers" real,"Series average" real) | SELECT MIN("Episode number") FROM table_17905 WHERE "Total viewers" = '614000' |
How many entrants have a mercedes fo 108w 2.4l v8 engine and over 0 points? | CREATE TABLE table_name_4 (year VARCHAR,engine VARCHAR,points VARCHAR) | SELECT COUNT(year) FROM table_name_4 WHERE engine = "mercedes fo 108w 2.4l v8" AND points > 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.