instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
has patient 016-9636 since 08/2105 excreted any output (ml)-urethral catheter straight-tip 16 fr. | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,d... | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput... |
What happened in the Men's doubles that had a Men's singles of marco vasconcelos, and a Year larger than 2000, and a Mixed doubles of alexandre paix o filipa lamy, and a Women's singles of telma santos? | CREATE TABLE table_36586 ("Year" real,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text) | SELECT "Men's doubles" FROM table_36586 WHERE "Men's singles" = 'marco vasconcelos' AND "Year" > '2000' AND "Mixed doubles" = 'alexandre paixão filipa lamy' AND "Women's singles" = 'telma santos' |
Name the position with height of 2.09 | CREATE TABLE table_70324 ("Player" text,"Height" real,"Position" text,"Year born" real,"Current Club" text) | SELECT "Position" FROM table_70324 WHERE "Height" = '2.09' |
When did the stadium where Bursaspor is the tenant open? | CREATE TABLE table_77 ("Stadium" text,"Capacity" real,"City" text,"Country" text,"Tenant" text,"Opening" real) | SELECT MIN("Opening") FROM table_77 WHERE "Tenant" = 'Bursaspor' |
Which Capacity has a City of london, and a Stadium of queen's club? | CREATE TABLE table_36014 ("Rank" text,"Stadium" text,"Capacity" real,"City" text,"Country" text) | SELECT AVG("Capacity") FROM table_36014 WHERE "City" = 'london' AND "Stadium" = 'queen''s club' |
In what year was the last last title received, by any of the countries? | CREATE TABLE table_10682862_68 (last_title INTEGER) | SELECT MAX(last_title) FROM table_10682862_68 |
What is the date of the game that had a visitor of Chicago? | CREATE TABLE table_name_22 (date VARCHAR,visitor VARCHAR) | SELECT date FROM table_name_22 WHERE visitor = "chicago" |
how many patients are with discharge location short term hospital and with procedure icd9 code 17? | 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 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND procedures.icd9_code = "17" |
What is the Finish of the Reno Bighorns Wins? | CREATE TABLE table_41326 ("Season" text,"Division" text,"Finish" text,"Wins" text,"Losses" text,"Pct." text) | SELECT "Finish" FROM table_41326 WHERE "Wins" = 'reno bighorns' |
What is the greatest Wins with Losses larger than 1? | CREATE TABLE table_62038 ("Year" real,"Result" text,"Matches" real,"Wins" real,"Draws" real,"Losses" real) | SELECT MAX("Wins") FROM table_62038 WHERE "Losses" > '1' |
Show the premise type and address type code for all customer addresses. | CREATE TABLE mailshot_customers (mailshot_id number,customer_id number,outcome_code text,mailshot_customer_date time)CREATE TABLE products (product_id number,product_category text,product_name text)CREATE TABLE customers (customer_id number,payment_method text,customer_name text,customer_phone text,customer_email text,... | SELECT T2.premises_type, T1.address_type_code FROM customer_addresses AS T1 JOIN premises AS T2 ON T1.premise_id = T2.premise_id |
what is the average number of times johan museeuw starred ? | CREATE TABLE table_204_156 (id number,"year" number,"crystal bicycle\n(best professional cyclist)" text,"best young rider" text,"best manager" text,"crystal drop of sweat\n(best helper)" text) | SELECT COUNT(*) FROM table_204_156 WHERE "crystal bicycle\n(best professional cyclist)" = 'johan museeuw' |
what are the flights on 1 1 1992 from BOSTON to SAN FRANCISCO | CREATE TABLE code_description (code varchar,description text)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TAB... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 1 AND date_day.month_number = 1 ... |
what number of patients with private insurance had the procedure titled transplant from cadaver? | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.long_title = "Transplant from cadaver" |
What place goes with the score of 70-66-65=201? | CREATE TABLE table_name_90 (place VARCHAR,score VARCHAR) | SELECT place FROM table_name_90 WHERE score = 70 - 66 - 65 = 201 |
Tell me the D 41 for D 43 of d 18 | CREATE TABLE table_name_63 (d_41 VARCHAR,d_43 VARCHAR) | SELECT d_41 FROM table_name_63 WHERE d_43 = "d 18" |
What is the name for Malay with a foundation in Iptura? | CREATE TABLE table_name_55 (name_in_malay VARCHAR,foundation VARCHAR) | SELECT name_in_malay FROM table_name_55 WHERE foundation = "iptura" |
Who was the opponents in the final on January 5, 2003, on a hard surface? | CREATE TABLE table_36992 ("Outcome" text,"Date" text,"Surface" text,"Partner" text,"Opponents in the final" text,"Score in the final" text) | SELECT "Opponents in the final" FROM table_36992 WHERE "Surface" = 'hard' AND "Date" = 'january 5, 2003' |
What is after intermediate algebra | CREATE TABLE table_19049 ("SUBJECT" text,"FRESHMAN (Grade 7)" text,"SOPHOMORE (Grade 8)" text,"JUNIOR (3rd Year)" text,"SENIOR (4th Year)" text) | SELECT "SENIOR (4th Year)" FROM table_19049 WHERE "SOPHOMORE (Grade 8)" = 'Intermediate Algebra' |
Where was the game played on January 23, 2008? | CREATE TABLE table_name_8 (location VARCHAR,date VARCHAR) | SELECT location FROM table_name_8 WHERE date = "january 23, 2008" |
how many films are under the publisher caliber comics ? | CREATE TABLE table_203_79 (id number,"year" number,"film" text,"publisher" text,"director" text,"distributor" text,"worldwide gross" text,"notes" text) | SELECT COUNT("film") FROM table_203_79 WHERE "publisher" = 'caliber comics' |
What are all the City/Neighborhoods whose extension is East Link and proposed parking lot status is yes and whose proposed station is Overlake transit Center? | CREATE TABLE table_25299 ("Station" text,"Extension" text,"City/Neighborhood" text,"Projected opening" text,"Park and ride?" text,"Funded by ST2 ?" text) | SELECT "City/Neighborhood" FROM table_25299 WHERE "Extension" = 'East Link' AND "Park and ride?" = 'Yes' AND "Station" = 'Overlake Transit Center' |
GIve the number of patients who died in or before the year 2112 and have the drug code sw100. | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2112.0" AND prescriptions.formulary_drug_cd = "SW100" |
How many episodes aired on 25 october 2012? | CREATE TABLE table_25721_3 (total_viewers VARCHAR,airdate VARCHAR) | SELECT COUNT(total_viewers) FROM table_25721_3 WHERE airdate = "25 October 2012" |
Which 2009 tournament was french open? | CREATE TABLE table_54433 ("Tournament" text,"2009" text,"2010" text,"2011" text,"2012" text,"2013" text) | SELECT "2009" FROM table_54433 WHERE "Tournament" = 'french open' |
what's the denomination with year being 2008 and reverse being football | CREATE TABLE table_12284476_8 (denomination VARCHAR,year VARCHAR,reverse VARCHAR) | SELECT denomination FROM table_12284476_8 WHERE year = 2008 AND reverse = "Football" |
Name the total number of race time for kevin harvick | CREATE TABLE table_24991 ("Year" real,"Date" text,"Driver" text,"Team" text,"Manufacturer" text,"Laps" text,"Miles (km)" text,"Race Time" text,"Average Speed (mph)" text,"Report" text) | SELECT COUNT("Race Time") FROM table_24991 WHERE "Driver" = 'Kevin Harvick' |
What is the country of the Representative that left office as incumbent? | CREATE TABLE table_name_29 (country VARCHAR,left_office VARCHAR) | SELECT country FROM table_name_29 WHERE left_office = "incumbent" |
provide the number of patients whose admission location is clinic referral/premature and year of birth is less than 2117? | 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 lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.dob_year < "2117" |
What is the party where the constituency is 10. Tindivanam? | CREATE TABLE table_25285 ("Constituency" text,"Winner" text,"Party" text,"Margin" real,"Runner-up a" text,"Party a" text) | SELECT "Party" FROM table_25285 WHERE "Constituency" = '10. Tindivanam' |
What is the highest Byes by Anakie who has an Against smaller than 2275? | CREATE TABLE table_name_14 (byes INTEGER,geelong_dfl VARCHAR,against VARCHAR) | SELECT MAX(byes) FROM table_name_14 WHERE geelong_dfl = "anakie" AND against < 2275 |
Find the total revenue of companies of each founder. | CREATE TABLE products (code number,name text,price number,manufacturer number)CREATE TABLE manufacturers (code number,name text,headquarter text,founder text,revenue number) | SELECT SUM(revenue), founder FROM manufacturers GROUP BY founder |
What is the Laker's record when they played against Kansas City Kings? | CREATE TABLE table_35732 ("Date" text,"Opponent" text,"Result" text,"Score" text,"Record" text,"Streak" text) | SELECT "Record" FROM table_35732 WHERE "Opponent" = 'kansas city kings' |
how many asian patients are less than 67 years of age? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.age < "67" |
Name the most touchdowns for field goals being 1 | CREATE TABLE table_72525 ("Player" text,"Position" text,"Starter" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Points" real) | SELECT MAX("Touchdowns") FROM table_72525 WHERE "Field goals" = '1' |
What is the Original Title, when Director is 'Ting Shan-Si', and when Film Title Used In Nomination is 'The 800 Heroes'? | CREATE TABLE table_49491 ("Year (Ceremony)" text,"Film title used in nomination" text,"Original title" text,"Director" text,"Result" text) | SELECT "Original title" FROM table_49491 WHERE "Director" = 'ting shan-si' AND "Film title used in nomination" = 'the 800 heroes' |
What is the Score of the game with the New York Rangers Home team with a Record of 8 27 5? | CREATE TABLE table_46243 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Score" FROM table_46243 WHERE "Home" = 'new york rangers' AND "Record" = '8–27–5' |
Who was the home team for the game where North Melbourne was the away team? | CREATE TABLE table_name_59 (home_team VARCHAR,away_team VARCHAR) | SELECT home_team FROM table_name_59 WHERE away_team = "north melbourne" |
Who's the incumbent in the district that first elected in 1969? | CREATE TABLE table_18169 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Results" text,"Candidates" text) | SELECT "Incumbent" FROM table_18169 WHERE "First elected" = '1969' |
For all employees who have the letters D or S in their first name, show me about the correlation between employee_id and salary in a scatter chart. | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME var... | SELECT EMPLOYEE_ID, SALARY FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
What is the 2nd leg for Barcelona Team 2? | CREATE TABLE table_43659 ("Team 1" text,"Agg." text,"Team 2" text,"1st leg" text,"2nd leg" text) | SELECT "2nd leg" FROM table_43659 WHERE "Team 2" = 'barcelona' |
WHAT IS THE AWAY TEAM WITH HOME OF LEICESTER CITY? | CREATE TABLE table_43809 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Attendance" text) | SELECT "Away team" FROM table_43809 WHERE "Home team" = 'leicester city' |
tell me the dose of d5w (glass bottle) that patient 65582 had been prescribed in this month? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,... | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65582) AND prescriptions.drug = 'd5w (glass bottle)' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 m... |
Which Australian has British of s? | CREATE TABLE table_name_61 (australian VARCHAR,british VARCHAR) | SELECT australian FROM table_name_61 WHERE british = "ɒs" |
During November 3 where august 21-22 is august 21, 2017? | CREATE TABLE table_27527 ("June 10-11" text,"March 27-29" text,"January 15-16" text,"November 3" text,"August 21-22" text) | SELECT "November 3" FROM table_27527 WHERE "August 21-22" = 'August 21, 2017' |
Where did steve smith go to school? | CREATE TABLE table_75449 ("Round" real,"Pick" real,"Player" text,"Position" text,"School/Club Team" text) | SELECT "School/Club Team" FROM table_75449 WHERE "Player" = 'steve smith' |
did the platelet count value of patient 15986 last measured on the current hospital visit be less than second to last measured on the current hospital visit? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)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 d_labitems (row_id number,itemid number,label text)CREATE TABLE o... | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15986 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'platelet count') ORDER BY labevents.cha... |
How many laps had a time of +2.987? | CREATE TABLE table_41335 ("Rider" text,"Bike" text,"Laps" real,"Time" text,"Grid" real) | SELECT COUNT("Laps") FROM table_41335 WHERE "Time" = '+2.987' |
What was Hawthorn's score when they were the home team? | CREATE TABLE table_33320 ("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_33320 WHERE "Home team" = 'hawthorn' |
What year did Cooper Car Company enter? | CREATE TABLE table_15672 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real) | SELECT AVG("Year") FROM table_15672 WHERE "Entrant" = 'cooper car company' |
Which Label-Nr has a Year smaller than 1968, and a Label of world pacific, and an album of chile con soul? | CREATE TABLE table_64647 ("Year" real,"Title" text,"From album" text,"Label" text,"Label-Nr" text) | SELECT "Label-Nr" FROM table_64647 WHERE "Year" < '1968' AND "Label" = 'world pacific' AND "From album" = 'chile con soul' |
What are all the places where Birgit Fischer competed? | CREATE TABLE table_14884844_2 (location VARCHAR,athletes VARCHAR) | SELECT location FROM table_14884844_2 WHERE athletes = "Birgit Fischer" |
What is the average episode that has September 11, 2007 as a region 1? | CREATE TABLE table_36340 ("Volume" text,"Discs" real,"Episodes" real,"Region 1 release" text,"Region 2 release" text,"Region 4 release" text) | SELECT AVG("Episodes") FROM table_36340 WHERE "Region 1 release" = 'september 11, 2007' |
What shows for Winners when it shows 3rd place of [[|]] (21 pts), and a Runner-up of united states (23 pts)? | CREATE TABLE table_69013 ("Year" text,"Venue" text,"Winners" text,"Runner-up" text,"3rd place" text) | SELECT "Winners" FROM table_69013 WHERE "3rd place" = '[[|]] (21 pts)' AND "Runner-up" = 'united states (23 pts)' |
how much does it cost to receive a diagnosis for leukocytosis nos? | CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE microbiologyevents (row... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'leukocytosis nos')) |
In what Round does Duke have a Pick larger than 9? | CREATE TABLE table_name_49 (round VARCHAR,pick VARCHAR,school VARCHAR) | SELECT COUNT(round) FROM table_name_49 WHERE pick > 9 AND school = "duke" |
What are the original air date(s) for season episode 20? | CREATE TABLE table_29109 ("Series #" real,"Season #" real,"Title" text,"Director" text,"Writer" text,"Original Airdate" text) | SELECT "Original Airdate" FROM table_29109 WHERE "Season #" = '20' |
Which varieties of apple typically have higher pesticide levels? | CREATE TABLE sampledata15 (sample_pk number,state text,year text,month text,day text,site text,commod text,source_id text,variety text,origin text,country text,disttype text,commtype text,claim text,quantity number,growst text,packst text,distst text)CREATE TABLE resultsdata15 (sample_pk number,commod text,commtype tex... | SELECT T1.variety FROM resultsdata15 AS T2 JOIN sampledata15 AS T1 ON T1.sample_pk = T2.sample_pk WHERE T2.commod = "AP" GROUP BY T1.variety ORDER BY SUM(T2.concen) DESC LIMIT 1 |
What's the time for a round of n/a when the opponent is mikhail ilyukhin? | CREATE TABLE table_57237 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Round" text,"Time" text,"Location" text) | SELECT "Time" FROM table_57237 WHERE "Round" = 'n/a' AND "Opponent" = 'mikhail ilyukhin' |
how many total elected seats in 1991 ? | CREATE TABLE table_203_558 (id number,"election" number,"number of\npopular votes" number,"% of\npopular votes" number,"total\nelected seats" text,"+/-" number) | SELECT "total\nelected seats" FROM table_203_558 WHERE "election" = 1991 |
How many air dates had 3.2 million viewers? | CREATE TABLE table_28701 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real,"U.S. viewers (millions)" text) | SELECT COUNT("Original air date") FROM table_28701 WHERE "U.S. viewers (millions)" = '3.2' |
With Lindsay Lee-Waters as a partner, what was the final score? | CREATE TABLE table_67546 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponents in the final" text,"Score in the final" text) | SELECT "Score in the final" FROM table_67546 WHERE "Partner" = 'lindsay lee-waters' |
Account Age Distribution for 10k+ Users. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)... | SELECT DATEDIFF(month, CreationDate, GETDATE()) AS Age, COUNT(*) AS "count" FROM Users WHERE Reputation >= 10000 AND DATEDIFF(month, CreationDate, GETDATE()) <= '##MaxAge:int?120##' GROUP BY DATEDIFF(month, CreationDate, GETDATE()) ORDER BY Age |
what is insurance of subject id 990? | 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 demographic.insurance FROM demographic WHERE demographic.subject_id = "990" |
Name the score for game for 25 | CREATE TABLE table_17103729_8 (score VARCHAR,game VARCHAR) | SELECT score FROM table_17103729_8 WHERE game = 25 |
When did the episode 1.13 air for the first time? | CREATE TABLE table_28283535_4 (date_aired VARCHAR,episode VARCHAR) | SELECT date_aired FROM table_28283535_4 WHERE episode = "1.13" |
how many patients were diagnosed with crnry athrscl natve vssl within the same month since 5 years ago after the diagnosis of rheumatoid arthritis? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate ... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'crnry athrscl natv... |
Who are the Rowers from Poland? | CREATE TABLE table_66353 ("Rank" real,"Rowers" text,"Country" text,"Time" text,"Notes" text) | SELECT "Rowers" FROM table_66353 WHERE "Country" = 'poland' |
What is the lowest total that has a rank less than 8, a silver greater than 6, and 20 as the bronze? | CREATE TABLE table_name_70 (total INTEGER,bronze VARCHAR,rank VARCHAR,silver VARCHAR) | SELECT MIN(total) FROM table_name_70 WHERE rank < 8 AND silver > 6 AND bronze = 20 |
Top 25 users from Thailand. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS Rank, Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Thailand%' LIMIT 25 |
Top users from Innsbruck, Austria. | CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%innsbruck%' OR UPPER(Location) LIKE '%INNSBRUCK%' OR Location LIKE '%Innsbruck%' ORDER BY Reputation DESC |
where are some restaurants good for french food ? | CREATE TABLE restaurant (id int,name varchar,food_type varchar,city_name varchar,rating "decimal)CREATE TABLE location (restaurant_id int,house_number int,street_name varchar,city_name varchar)CREATE TABLE geographic (city_name varchar,county varchar,region varchar) | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE restaurant.food_type = 'french' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5 |
Who lost with a time of 2:42? | CREATE TABLE table_name_9 (loss VARCHAR,time VARCHAR) | SELECT loss FROM table_name_9 WHERE time = "2:42" |
Name the segment b for graphite s fly rod | CREATE TABLE table_15187735_8 (segment_b VARCHAR,segment_c VARCHAR) | SELECT segment_b FROM table_15187735_8 WHERE segment_c = "Graphite s Fly Rod" |
diagnosed with type ii diabetes for at least one year | CREATE TABLE table_train_262 ("id" int,"gender" string,"hemoglobin_a1c_hba1c" float,"obesity" bool,"diabetic" string,"hba1c" float,"body_mass_index_bmi" float,"age" float,"NOUSE" float) | SELECT * FROM table_train_262 WHERE diabetic = 'ii' |
Which engineer has visited the most times? Show the engineer id, first name and last name. | CREATE TABLE Engineer_Visits (Id VARCHAR)CREATE TABLE Maintenance_Engineers (engineer_id VARCHAR,first_name VARCHAR,last_name VARCHAR) | SELECT T1.engineer_id, T1.first_name, T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 GROUP BY T1.engineer_id ORDER BY COUNT(*) DESC LIMIT 1 |
Which Transfer fee has Ends larger than 2011, and a Moving from of psv? | CREATE TABLE table_name_27 (transfer_fee VARCHAR,ends VARCHAR,moving_from VARCHAR) | SELECT transfer_fee FROM table_name_27 WHERE ends > 2011 AND moving_from = "psv" |
For those records from the products and each product's manufacturer, find founder and the average of revenue , and group by attribute founder, and visualize them by a bar chart. | 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 Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder |
For those records from the products and each product's manufacturer, show me about the distribution of name and the average of price , and group by attribute name in a bar chart, and could you display from high to low by the Name? | 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 T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC |
Which Nanquan has a Nandao larger than 9.49, and a Rank of 4? | CREATE TABLE table_78857 ("Rank" real,"Athlete" text,"Nandao" real,"Nanquan" real,"Total" real) | SELECT "Nanquan" FROM table_78857 WHERE "Nandao" > '9.49' AND "Rank" = '4' |
Find the number of courses offered by Psychology department in each semester with a pie chart. | CREATE TABLE course (course_id varchar(8),title varchar(50),dept_name varchar(20),credits numeric(2,0))CREATE TABLE section (course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0),building varchar(15),room_number varchar(7),time_slot_id varchar(4))CREATE TABLE department (dept_name varchar(20),bui... | SELECT semester, COUNT(semester) FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' GROUP BY semester |
What is the average 2011-03, when Unemployment is Sweden, and when 2009-03 is greater than 8? | CREATE TABLE table_7494 ("Unemployment" text,"2007-03" real,"2008-03" real,"2009-03" real,"2010-03" real,"2011-03" real,"2012-03" real) | SELECT AVG("2011-03") FROM table_7494 WHERE "Unemployment" = 'sweden' AND "2009-03" > '8' |
Name the sport for men's light flyweight with medal of gold | CREATE TABLE table_name_75 (sport VARCHAR,medal VARCHAR,event VARCHAR) | SELECT sport FROM table_name_75 WHERE medal = "gold" AND event = "men's light flyweight" |
What is Player, when Country is 'United States', and when Year(s) Won is '1976'? | CREATE TABLE table_49418 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text) | SELECT "Player" FROM table_49418 WHERE "Country" = 'united states' AND "Year(s) won" = '1976' |
What is the lowest Preliminary score of a contestant that has an Evening Gown score of 8.472? | CREATE TABLE table_71102 ("State" text,"Preliminaries" real,"Interview" real,"Swimsuit" real,"Evening Gown" real,"Average" real) | SELECT MIN("Preliminaries") FROM table_71102 WHERE "Evening Gown" = '8.472' |
What are the subdivision names (RU) where the subdivision name (BE) is Hrodzenskaya Voblasts'? | CREATE TABLE table_30886 ("Code" text,"Subdivision name (be) (BGN/PCGN)" text,"Subdivision name (be) (GOST)" text,"Subdivision name (ru) (BGN/PCGN)" text,"Subdivision name (ru) (GOST)" text,"Subdivision category" text) | SELECT "Subdivision name ( ru ) (GOST)" FROM table_30886 WHERE "Subdivision name ( be ) (BGN/PCGN)" = 'Hrodzenskaya voblasts' |
What teams do the players from TPS (Finland) play for? | CREATE TABLE table_1013129_11 (nhl_team VARCHAR,college_junior_club_team VARCHAR) | SELECT nhl_team FROM table_1013129_11 WHERE college_junior_club_team = "TPS (Finland)" |
what is procedure short title of subject name jerry deberry? | 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 procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Jerry Deberry" |
when did patient 49176 receive an mcv laboratory test for the first time since 01/2105? | CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE admissions (row_id number,subject_id number,hadm_id ... | SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mcv') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49176) AND STRFTIME('%y-%m', labevents.charttime) >= '2105-01' ORDER BY labevent... |
Which Format is listed that has a Region of China? | CREATE TABLE table_name_93 (format VARCHAR,region VARCHAR) | SELECT format FROM table_name_93 WHERE region = "china" |
what are the five most frequently given diagnoses for patients who had oth chest cage ostectomy before within 2 months, until 4 years ago? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE outputevents (row_id number,sub... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi... |
Who did the Rockies play at the game that had a score of 6 5 (10)? | CREATE TABLE table_name_22 (opponent VARCHAR,score VARCHAR) | SELECT opponent FROM table_name_22 WHERE score = "6–5 (10)" |
What is the dma when the format is rhythmic contemporary? | CREATE TABLE table_22826 ("DMA" real,"Market" text,"Station" text,"Frequency" text,"Branding" text,"Format" text) | SELECT MIN("DMA") FROM table_22826 WHERE "Format" = 'Rhythmic Contemporary' |
how many patients until 2104 were diagnosed with gi bleeding within 2 months after they underwent glucose - d10w? | 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 cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype tex... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'glucose - d10w' AND STRFTIME('%y', treatment.treatmenttime) <= '2104') AS t1 JOIN (SELECT patient.uniquepid,... |
What is Catalog, when Format is CD, when Region is US, when Date is before 2004, and when Label is Taang! Records? | CREATE TABLE table_name_32 (catalog VARCHAR,label VARCHAR,date VARCHAR,format VARCHAR,region VARCHAR) | SELECT catalog FROM table_name_32 WHERE format = "cd" AND region = "us" AND date < 2004 AND label = "taang! records" |
Tell me the surface for eastbourne 14 june 1999 | CREATE TABLE table_4368 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Surface" FROM table_4368 WHERE "Tournament" = 'eastbourne' AND "Date" = '14 june 1999' |
What is the death date of the archbishop who was ordained as bishop April 26, 1927? | CREATE TABLE table_20889 ("Archbishop" text,"Born" text,"Ordained Priest" text,"Ordained Bishop" text,"Appointed Archbishop" text,"Vacated throne" text,"Died" text) | SELECT "Died" FROM table_20889 WHERE "Ordained Bishop" = 'April 26, 1927' |
What is the first year where the assassination attempt was at Martyrs' Mausoleum, Rangoon, Burma? | CREATE TABLE table_27406 ("Year" real,"Date" text,"Intended Victim(s)" text,"Title at the Time" text,"Location" text,"Would-be Assassin(s)" text,"Method" text,"Initial Outcome / Notes" text) | SELECT MIN("Year") FROM table_27406 WHERE "Location" = 'Martyrs'' Mausoleum, Rangoon, Burma' |
HTML5 thread volume, page views, unique OPs by month. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE Comments (Id number,PostId number,Score number,Te... | SELECT COUNT(*) AS Volume, SUM(ViewCount) AS PageViews, COUNT(DISTINCT OwnerUserId) AS UniqueOPs, TIME_TO_STR(P.CreationDate, '%Y') AS "year", TIME_TO_STR(P.CreationDate, '%m') AS Month FROM Posts AS P WHERE (Tags LIKE '%<html5%' OR Tags LIKE '%<html-canvas>%' OR Tags LIKE '%<xhtml5>%') AND PostTypeId = 1 AND Community... |
Name the total number of places for vicky gordon and points more than 23 | CREATE TABLE table_31765 ("Draw" real,"Artist" text,"Song" text,"Place" real,"Points" real) | SELECT COUNT("Place") FROM table_31765 WHERE "Artist" = 'vicky gordon' AND "Points" > '23' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.