instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
User List: Top N - Armenia - with false positive exclusions. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId num... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location, LastAccessDate, UpVotes, DownVotes FROM Users WHERE (Location LIKE '%Armenia%' OR Location LIKE '%Yerevan%') AND NOT (Location LIKE '%Colombia%' OR Location LIKE '%Quind%o%') LIMIT 100 |
What is Opposing Teams, when Against is '20', and when Venue is 'Twickenham , London'? | CREATE TABLE table_name_35 (opposing_teams VARCHAR,against VARCHAR,venue VARCHAR) | SELECT opposing_teams FROM table_name_35 WHERE against = 20 AND venue = "twickenham , london" |
What was the result when they played at Michigan State? | CREATE TABLE table_50220 ("Date" text,"Opponent#" text,"Rank #" text,"Site" text,"Result" text,"Attendance" text) | SELECT "Result" FROM table_50220 WHERE "Opponent#" = 'at michigan state' |
What is the birthplace of the player who is 190 CM tall, plays the D position, and wears number 11? | CREATE TABLE table_42261 ("Position" text,"Jersey number" real,"Name v t e" text,"Height (cm)" real,"Weight (kg)" real,"Birthplace" text,"2009-10 team" text,"NHL rights,if any" text) | SELECT "Birthplace" FROM table_42261 WHERE "Position" = 'd' AND "Height (cm)" = '190' AND "Jersey number" = '11' |
what percentile is a -monos value of 13.0 among patients of the same age as patient 027-136480 during their current hospital encounter? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE lab (labid number,patientunitstayid number,labna... | SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = '-monos' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '027-136480' AND patient.h... |
what was the first work completed ? | CREATE TABLE table_204_191 (id number,"title" text,"artist" text,"year" text,"location/gps coordinates" text,"material" text,"dimensions" text,"owner" text) | SELECT "title" FROM table_204_191 ORDER BY "year" LIMIT 1 |
which examples are pronounced et in australian | CREATE TABLE table_17798093_20 (examples VARCHAR,australian VARCHAR) | SELECT examples FROM table_17798093_20 WHERE australian = "et" |
What is the sum of laps for grid 20? | CREATE TABLE table_name_53 (laps INTEGER,grid VARCHAR) | SELECT SUM(laps) FROM table_name_53 WHERE grid = 20 |
What tournament had a runner(s)-up of Scott Hoch & Kenny Perry? | CREATE TABLE table_name_12 (tournament VARCHAR,runner_s__up VARCHAR) | SELECT tournament FROM table_name_12 WHERE runner_s__up = "scott hoch & kenny perry" |
Who directed a film for Cracking Film Productions? | CREATE TABLE table_name_80 (director_s_ VARCHAR,recipient VARCHAR) | SELECT director_s_ FROM table_name_80 WHERE recipient = "cracking film productions" |
the mercedes championships and sony open in hawaii are located in what state ? | CREATE TABLE table_203_531 (id number,"date" text,"tournament" text,"location" text,"winner" text,"score" text,"1st prize ($)" number) | SELECT "location" FROM table_203_531 WHERE "tournament" = 'mercedes championships' |
What is NiCd, when Type is 'Capacity under 500mA constant Drain'? | CREATE TABLE table_75748 ("Type" text,"Zinc\u2013carbon" text,"Alkaline" text,"Li-FeS 2" text,"NiCd" text,"NiMH" text) | SELECT "NiCd" FROM table_75748 WHERE "Type" = 'capacity under 500ma constant drain' |
What was the average pick with Ed O'Bannon and a round smaller than 1? | CREATE TABLE table_name_74 (pick INTEGER,player VARCHAR,round VARCHAR) | SELECT AVG(pick) FROM table_name_74 WHERE player = "ed o'bannon" AND round < 1 |
What was the average number of members Nominated by the Taoiseach, when the Agricultural Panel had less than 1 member, and when the Administrative Panel had fewer than 0 members? | CREATE TABLE table_40909 ("Administrative Panel" real,"Agricultural Panel" real,"Cultural and Educational Panel" real,"Industrial and Commercial Panel" real,"Labour Panel" real,"National University of Ireland" real,"University of Dublin" real,"Nominated by the Taoiseach" real,"Total" real) | SELECT AVG("Nominated by the Taoiseach") FROM table_40909 WHERE "Agricultural Panel" < '1' AND "Administrative Panel" < '0' |
Play-by-play of sean grande, and a Flagship Station of wrko involved what color commentator? | CREATE TABLE table_name_99 (color_commentator_s_ VARCHAR,play_by_play VARCHAR,flagship_station VARCHAR) | SELECT color_commentator_s_ FROM table_name_99 WHERE play_by_play = "sean grande" AND flagship_station = "wrko" |
For those records from the products and each product's manufacturer, return a scatter chart about the correlation between price and code , and group by attribute 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.Price, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name |
How many different results of the population count in 2001 are there for the census division whose population in 1996 is 880859? | CREATE TABLE table_2134521_1 (pop__2001_ VARCHAR,pop__1996_ VARCHAR) | SELECT COUNT(pop__2001_) FROM table_2134521_1 WHERE pop__1996_ = 880859 |
What is the minimum number of 50s scored? | CREATE TABLE table_27922491_24 (Id VARCHAR) | SELECT MIN(50 AS s) FROM table_27922491_24 |
the muncie flyers played from 1910 to 1925 in all but one of those years . which year did the flyers not play ? | CREATE TABLE table_200_32 (id number,"year" number,"w" number,"l" number,"t" number,"finish" text,"coach" text) | SELECT "year" FROM table_200_32 WHERE "w" IS NULL |
What was the 3 UTR sequence when Coding was 6a 3 and the GenBank id is nm_001093770.2? | CREATE TABLE table_name_64 (coding VARCHAR,genbank_id VARCHAR) | SELECT 3 AS ’utr_sequence FROM table_name_64 WHERE coding = "6a 3" AND genbank_id = "nm_001093770.2" |
What medal was won in the 1996 Atlanta games in wrestling? | CREATE TABLE table_38769 ("Medal" text,"Name" text,"Games" text,"Sport" text,"Event" text) | SELECT "Medal" FROM table_38769 WHERE "Games" = '1996 atlanta' AND "Sport" = 'wrestling' |
For all employees who have the letters D or S in their first name, find hire_date and the sum of employee_id bin hire_date by weekday, and visualize them by a bar chart, display by the Y in asc. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE jobs (JOB_ID ... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(EMPLOYEE_ID) |
What is the Date of the game with a Score of L 115 118 (OT)? | CREATE TABLE table_44833 ("Game" text,"Date" text,"Team" text,"Score" text,"Location Attendance" text,"Series" text) | SELECT "Date" FROM table_44833 WHERE "Score" = 'l 115–118 (ot)' |
what are the three most frequent diagnoses that patients were diagnosed within 2 months after receiving a peripheral nerve graft? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CR... | 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... |
Which state includes the Harry A. Gampel Pavilion venue? | CREATE TABLE table_name_10 (state VARCHAR,venue VARCHAR) | SELECT state FROM table_name_10 WHERE venue = "harry a. gampel pavilion" |
which tier appears the most ? | CREATE TABLE table_204_636 (id number,"season" text,"tier" number,"division" text,"pos." text,"notes" text) | SELECT "tier" FROM table_204_636 GROUP BY "tier" ORDER BY COUNT(*) DESC LIMIT 1 |
Which shooter had a total of 11 at the WC Munich with a score of 6? | CREATE TABLE table_59065 ("Shooter" text,"Event" text,"Rank points" text,"Score points" text,"Total" text) | SELECT "Shooter" FROM table_59065 WHERE "Total" = '11' AND "Event" = 'wc munich' AND "Score points" = '6' |
Can you tell me the total number of Total that has the First round of 0, and the Finals smaller than 5? | CREATE TABLE table_60530 ("First round" text,"Semifinals" real,"Conference Finals" real,"Finals" real,"Total" real) | SELECT COUNT("Total") FROM table_60530 WHERE "First round" = '0' AND "Finals" < '5' |
What is the entry for Part 1 for class 7d? | CREATE TABLE table_name_81 (part_1 VARCHAR,class VARCHAR) | SELECT part_1 FROM table_name_81 WHERE class = "7d" |
Which Release price (USD ) that has a Release date on april 2012 and a Part number(s) of cm8063701211900bx80637i73770s? | CREATE TABLE table_13802 ("Model number" text,"sSpec number" text,"Cores" text,"Frequency" text,"Turbo" text,"L2 cache" text,"L3 cache" text,"GPU model" text,"GPU frequency" text,"Socket" text,"I/O bus" text,"Release date" text,"Part number(s)" text,"Release price (USD)" text) | SELECT "Release price ( USD )" FROM table_13802 WHERE "Release date" = 'april 2012' AND "Part number(s)" = 'cm8063701211900bx80637i73770s' |
Who built the ship that is 42.8 m long and was delivered in 2007? | CREATE TABLE table_name_83 (builder VARCHAR,length VARCHAR,delivery VARCHAR) | SELECT builder FROM table_name_83 WHERE length = "42.8 m" AND delivery = 2007 |
what is maximum days of hospital stay of patients whose primary disease is atrial fibrillation\thoracoscopic maze procedure bilateral/sda? | 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 diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "ATRIAL FIBRILLATION\THORACOSCOPIC MAZE PROCEDURE BILATERAL/SDA" |
What is the name of the diety for the river of sone? | CREATE TABLE table_44785 ("Name of Deity" text,"Bhuta(Tatwa)" text,"Name of the Stone (Sila)" text,"Name of the River" text,"Name of the State where found in India" text) | SELECT "Name of Deity" FROM table_44785 WHERE "Name of the River" = 'sone' |
history of nephrolithiasis | CREATE TABLE table_train_59 ("id" int,"bone_marrow_transplant" bool,"nephrolithiasis_history" bool,"taking_vitamin_c" bool,"immune_suppression" bool,"neutrophil_count" int,"monoclonal_antibodies_mab" int,"sepsis" bool,"glucose_6_phosphate_dehydrogenase_deficiency_g6pd" int,"NOUSE" float) | SELECT * FROM table_train_59 WHERE nephrolithiasis_history = 1 |
Show the number of date of notes from each date of notes | CREATE TABLE Behavior_Incident (incident_id INTEGER,incident_type_code VARCHAR(10),student_id INTEGER,date_incident_start DATETIME,date_incident_end DATETIME,incident_summary VARCHAR(255),recommendations VARCHAR(255),other_details VARCHAR(255))CREATE TABLE Students_in_Detention (student_id INTEGER,detention_id INTEGER,... | SELECT date_of_notes, COUNT(date_of_notes) FROM Assessment_Notes |
Name the total number of bids of the sun belt conference | CREATE TABLE table_16288 ("Conference" text,"# of Bids" real,"Record" text,"Win %" text,"Round of 32" real,"Sweet Sixteen" real,"Elite Eight" real,"Final Four" real,"Championship Game" real) | SELECT COUNT("# of Bids") FROM table_16288 WHERE "Conference" = 'Sun Belt' |
When north melbourne played as the home team, what was the away team score? | CREATE TABLE table_name_7 (away_team VARCHAR,home_team VARCHAR) | SELECT away_team AS score FROM table_name_7 WHERE home_team = "north melbourne" |
What is the highest number of maidens when the bowling best was 1/13? | CREATE TABLE table_15893020_2 (maidens INTEGER,best_bowling VARCHAR) | SELECT MAX(maidens) FROM table_15893020_2 WHERE best_bowling = "1/13" |
What was the home team score at North Melbourne's away game? | CREATE TABLE table_name_11 (home_team VARCHAR,away_team VARCHAR) | SELECT home_team AS score FROM table_name_11 WHERE away_team = "north melbourne" |
Where did the ol go to college? | CREATE TABLE table_23798 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text) | SELECT "College" FROM table_23798 WHERE "Position" = 'OL' |
what was the drug prescribed to patient 009-12985 until 65 months ago for the last time? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE patient (uniquepid text,patienthealthsy... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-12985')) AND DATETIME(medication.drugstarttime) <= DATETIME(CUR... |
aspero and caral are both cities that can be found in which country ? | CREATE TABLE table_204_965 (id number,"year" text,"city" text,"state,province,dept.,etc." text,"country" text,"notes" text) | SELECT "country" FROM table_204_965 WHERE "city" = 'aspero' |
what is the minimum pos with clubs being 16 | CREATE TABLE table_19349 ("Pos" real,"Member Association" text,"Points (total 500)" real,"Clubs" text,"Group stage" real,"Play-off" real,"AFC Cup" real) | SELECT MIN("Pos") FROM table_19349 WHERE "Clubs" = '16' |
provide the number of patients whose gender is f and primary disease is atrial septal defect\mitral valve replacement;repair atrial-septal defect/sda? | 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 WHERE demographic.gender = "F" AND demographic.diagnosis = "ATRIAL SEPTAL DEFECT\MITRAL VALVE REPLACEMENT;REPAIR ATRIAL-SEPTAL DEFECT/SDA" |
How many upvotes do I have for each tag (by User Name)?. how long before I get tag badges? | CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE T... | SELECT TagName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Users ON Posts.OwnerUserId = Users.Id INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE Users.DisplayName = @UserName GROUP BY TagName ORDER BY... |
What is the total number of the crowd at Glenferrie Oval? | CREATE TABLE table_name_28 (crowd VARCHAR,venue VARCHAR) | SELECT COUNT(crowd) FROM table_name_28 WHERE venue = "glenferrie oval" |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, a line chart shows the trend of employee_id over hire_date , could you order HIRE_DATE in descending order please? | 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 locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE departments (D... | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE DESC |
What is the Outcome of the match on 12 september 2004? | CREATE TABLE table_41660 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent in the final" text,"Score" text) | SELECT "Outcome" FROM table_41660 WHERE "Date" = '12 september 2004' |
What was the Goal in Stade Roi Baudouin, Brussels? | CREATE TABLE table_68952 ("Goal" real,"Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT AVG("Goal") FROM table_68952 WHERE "Venue" = 'stade roi baudouin, brussels' |
the episode directed by art dielhenn was what number in the series? | CREATE TABLE table_2818164_8 (no_in_series VARCHAR,directed_by VARCHAR) | SELECT no_in_series FROM table_2818164_8 WHERE directed_by = "Art Dielhenn" |
which single did she first release ? | CREATE TABLE table_204_574 (id number,"year" number,"title" text,"peak chart positions\nswe" number,"peak chart positions\nswi" number,"peak chart positions\nuk" number,"album" text) | SELECT "title" FROM table_204_574 WHERE id = 1 |
Which model had a Specification of dl-718? | CREATE TABLE table_70790 ("Model" text,"Specification" text,"Build date" text,"Total produced" real,"Wheel arrangement" text,"Prime mover" text,"Power output" text) | SELECT "Model" FROM table_70790 WHERE "Specification" = 'dl-718' |
for the first time, what procedure did during a year before patient 008-39015 receive? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientun... | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-39015')) AND DATETIME(treatment.treatmenttime, 'start of year... |
Get me the number of protestant quaker religious background patients who had a thyroid stimulating hormone lab test. | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "PROTESTANT QUAKER" AND lab.label = "Thyroid Stimulating Hormone" |
until 3 years ago how many patients were prescribed with metoprolol in the same hospital visit after they had undergone 1 int mam-cor art bypass? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_labitems (row_id number,itemid number,label 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 inputevents_cv (row... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id 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_... |
What machine did Kenneth E. Herbert ride? | CREATE TABLE table_79851 ("Rider" text,"Date" text,"Place" text,"Race" text,"Event" text,"Machine" text) | SELECT "Machine" FROM table_79851 WHERE "Rider" = 'kenneth e. herbert' |
provide the number of patients whose religion is catholic and diagnoses long title is personal history, urinary (tract) infection? | 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 WHERE demographic.religion = "CATHOLIC" AND diagnoses.long_title = "Personal history, urinary (tract) infection" |
What is Opening, when White is Kramnik, when Year is less than 2001, and when Tournament is 'Siemens Giants'? | CREATE TABLE table_59336 ("White" text,"Black" text,"Year" real,"Result" text,"Moves" real,"Tournament" text,"Opening" text) | SELECT "Opening" FROM table_59336 WHERE "White" = 'kramnik' AND "Year" < '2001' AND "Tournament" = 'siemens giants' |
when was the last time that patient 030-40287 was tested for base excess during their last hospital visit? | 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 lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-40287' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitala... |
How many tourists did not make any visit? | CREATE TABLE royal_family (royal_family_id number,royal_family_details text)CREATE TABLE features (feature_id number,feature_details text)CREATE TABLE ref_hotel_star_ratings (star_rating_code text,star_rating_description text)CREATE TABLE staff (staff_id number,tourist_attraction_id number,name text,other_details text)... | SELECT COUNT(*) FROM visitors WHERE NOT tourist_id IN (SELECT tourist_id FROM visits) |
psa > 4 in male | CREATE TABLE table_dev_5 ("id" int,"anemia" bool,"gender" string,"hiv_infection" bool,"hemoglobin_a1c_hba1c" float,"panel_reactive_antibodies" int,"psa" int,"body_mass_index_bmi" float,"NOUSE" float) | SELECT * FROM table_dev_5 WHERE psa > 4 AND gender = 'male' |
Which party's candidate is Grech Louis Grech? | CREATE TABLE table_name_36 (party VARCHAR,candidate VARCHAR) | SELECT party FROM table_name_36 WHERE candidate = "grech louis grech" |
What location attendance had a score of l 92 116? | CREATE TABLE table_39433 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Series" text) | SELECT "Location Attendance" FROM table_39433 WHERE "Score" = 'l 92–116' |
Which season had less than 25.4 viewers and had a viewer rank of #6? | CREATE TABLE table_61168 ("Season" real,"Season premiere" text,"Season finale" text,"TV season" text,"Viewer rank (#)" text,"Households/Viewers (in millions)" real) | SELECT MIN("Season") FROM table_61168 WHERE "Households/Viewers (in millions)" < '25.4' AND "Viewer rank (#)" = '#6' |
What's the transcription of the thai name of the month ? | CREATE TABLE table_180802_2 (transcription VARCHAR,thai_name VARCHAR) | SELECT transcription FROM table_180802_2 WHERE thai_name = "พฤษภาคม" |
hba1c > 7 % | CREATE TABLE table_dev_10 ("id" int,"gender" string,"hba1c" float,"serum_creatinine" float,"alcohol_abuse" bool,"baseline_hemoglobin_hgb" float,"NOUSE" float) | SELECT * FROM table_dev_10 WHERE hba1c > 7 |
how many patients whose death status is 1 and diagnoses short title is surg compl-body syst nec? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Surg compl-body syst NEC" |
show me all the flights from SAN FRANCISCO to BOSTON for 8 31 1991 | CREATE TABLE code_description (code varchar,description text)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)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 ... | 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 = 'BOSTON' AND date_day.day_number = 31 AND date_day.month_number = 8 AND da... |
What is the Word Form, when the Khmer is greater than , and the UNGEGN is (mu y) d b le n? | CREATE TABLE table_70096 ("Value" text,"Khmer" real,"Word Form" text,"UNGEGN" text,"ALA-LC" text,"Notes" text) | SELECT "Word Form" FROM table_70096 WHERE "Khmer" > '១០០០០០' AND "UNGEGN" = '(muŏy) dáb leăn' |
What week has a Record of 12-2? | CREATE TABLE table_32452 ("Week" text,"Date" text,"Opponent" text,"Result" text,"Kickoff" text,"Game site" text,"Record" text,"Attendance" text) | SELECT "Week" FROM table_32452 WHERE "Record" = '12-2' |
Name the bulgarian for jullie hadden gehoord | CREATE TABLE table_1841901_1 (bulgarian VARCHAR,dutch VARCHAR) | SELECT bulgarian FROM table_1841901_1 WHERE dutch = "jullie hadden gehoord" |
What is the To par of the Player from Argentina? | CREATE TABLE table_name_39 (to_par VARCHAR,country VARCHAR) | SELECT to_par FROM table_name_39 WHERE country = "argentina" |
What is the production code of the episode that was watched by 3.81 million U.S. viewers? | CREATE TABLE table_4166 ("No. in series" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text) | SELECT "Production code" FROM table_4166 WHERE "U.S. viewers (million)" = '3.81' |
What team lost on 20 August 1989? | CREATE TABLE table_name_82 (losingteam VARCHAR,cup_finaldate VARCHAR) | SELECT losingteam FROM table_name_82 WHERE cup_finaldate = "20 august 1989" |
Name the most pick # for overall of 204 | CREATE TABLE table_name_52 (pick__number INTEGER,overall VARCHAR) | SELECT MAX(pick__number) FROM table_name_52 WHERE overall = 204 |
For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id. | CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varc... | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID |
what is primary disease and admission time of subject id 25167? | 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 demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.subject_id = "25167" |
what was the marital status of patient 81871 in the first hospital encounter? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)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 icustays (r... | SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 81871 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 |
For all employees who have the letters D or S in their first name, show me about the distribution of job_id and the average of manager_id , and group by attribute job_id in a bar chart, rank bar from low to high order. | CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,... | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID |
What are the catalog entry names of the products with next entry ID above 8? | CREATE TABLE catalog_structure (catalog_level_number number,catalog_id number,catalog_level_name text)CREATE TABLE catalogs (catalog_id number,catalog_name text,catalog_publisher text,date_of_publication time,date_of_latest_revision time)CREATE TABLE attribute_definitions (attribute_id number,attribute_name text,attrib... | SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id > 8 |
How long has the team who owns North Shore Events Centre Vector Arena been active? | CREATE TABLE table_283203_1 (years_active VARCHAR,home_venue VARCHAR) | SELECT years_active FROM table_283203_1 WHERE home_venue = "North Shore Events Centre Vector Arena" |
How many picks does Auburn have? | CREATE TABLE table_name_47 (pick VARCHAR,school_club_team VARCHAR) | SELECT COUNT(pick) FROM table_name_47 WHERE school_club_team = "auburn" |
What number in season is the episode directed by Gene Stupnitsky? | CREATE TABLE table_17482534_1 (no_in_season VARCHAR,directed_by VARCHAR) | SELECT no_in_season FROM table_17482534_1 WHERE directed_by = "Gene Stupnitsky" |
What is the draw total that has under 5 places, under 62 points, and a Song of 'ne izdajte me'? | CREATE TABLE table_10541 ("Draw" real,"Artist" text,"Song" text,"Points" real,"Place" real) | SELECT SUM("Draw") FROM table_10541 WHERE "Place" < '5' AND "Points" < '62' AND "Song" = 'ne izdajte me' |
What percentage of voters choise McCain in Burlington? | CREATE TABLE table_23638 ("County" text,"Obama %" text,"Obama #" real,"McCain %" text,"McCain #" real,"Others %" text,"Others #" real) | SELECT "McCain %" FROM table_23638 WHERE "County" = 'Burlington' |
What year is the 2004 shake don't stir? | CREATE TABLE table_76404 ("Year" text,"2009" text,"2008" text,"2007" text,"2006" text,"2005" text,"2004" text,"2003" text) | SELECT "Year" FROM table_76404 WHERE "2004" = 'shake don''t stir' |
Which Venue has a Year larger than 1868, and an Opposition of derbyshire? | CREATE TABLE table_5403 ("Score" real,"Opposition" text,"Venue" text,"City" text,"Year" real) | SELECT "Venue" FROM table_5403 WHERE "Year" > '1868' AND "Opposition" = 'derbyshire' |
what is the least expensive one way fare from BOSTON to PITTSBURGH | CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE code_description (code varchar,description text)CREATE TABLE flight_leg (flight_id int,leg_number int,l... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... |
Which Label has a Format of cd, a Country of Japan and a Catalog of vjcp-68403? | CREATE TABLE table_name_89 (label VARCHAR,catalog VARCHAR,format VARCHAR,country VARCHAR) | SELECT label FROM table_name_89 WHERE format = "cd" AND country = "japan" AND catalog = "vjcp-68403" |
What is the Mainly For with a displacement of 997 cc in a year before 1962? | CREATE TABLE table_name_61 (mainly_for VARCHAR,year VARCHAR,displacement VARCHAR) | SELECT mainly_for FROM table_name_61 WHERE year < 1962 AND displacement = "997 cc" |
Name the country vijay singh is from | CREATE TABLE table_70195 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Country" FROM table_70195 WHERE "Player" = 'vijay singh' |
What has Yejin Kim published at Immune network ? | CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE field (fieldid int)CREATE TABLE dataset (datasetid int,datasetname varchar)CREA... | SELECT DISTINCT paper.paperid FROM author, paper, venue, writes WHERE author.authorname = 'Yejin Kim' AND venue.venueid = paper.venueid AND venue.venuename = 'Immune network' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid |
How many schools did darryl dawkins play for | CREATE TABLE table_16859 ("Player" text,"No." real,"Nationality" text,"Position" text,"Years for Jazz" text,"School/Club Team" text) | SELECT COUNT("School/Club Team") FROM table_16859 WHERE "Player" = 'Darryl Dawkins' |
What is the Score of the game of the Player in Place 4? | CREATE TABLE table_76986 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real) | SELECT "Score" FROM table_76986 WHERE "Place" = '4' |
was patient 72198 diagnosed with any in 2105? | 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 patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE procedur... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 72198) AND STRFTIME('%y', diagnoses_icd.charttime) = '2105' |
How much Longitude has a County of nelson, and a Latitude larger than 47.980183? | CREATE TABLE table_name_87 (longitude INTEGER,county VARCHAR,latitude VARCHAR) | SELECT SUM(longitude) FROM table_name_87 WHERE county = "nelson" AND latitude > 47.980183 |
What is the average number of laps in 1949? | CREATE TABLE table_69504 ("Year" text,"Start" text,"Qual" text,"Rank" text,"Finish" text,"Laps" real) | SELECT AVG("Laps") FROM table_69504 WHERE "Year" = '1949' |
what flights go from PITTSBURGH to NEWARK after 1505 in the afternoon | CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE airport_service (city_code varchar,airport_code varchar,... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEWARK' AND flight.departure_time > 1505 AND flight.to_airport = AIRPORT_SERVICE_1.airpor... |
What is the average pick of school/club team kutztown state with a round 4? | CREATE TABLE table_46763 ("Round" real,"Pick" real,"Player" text,"Position" text,"School/Club Team" text) | SELECT AVG("Pick") FROM table_46763 WHERE "Round" = '4' AND "School/Club Team" = 'kutztown state' |
DATEDIFF(day, DATEADD(yy, DATEDIFF(yy,0,getdate()), 0), today) /DATEDIFF(day, DATEADD(y. | CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Comments (Id number,PostId number,Score number,Text te... | SELECT DATEADD(mm, DATEDIFF(mm, 0, DATEADD(ms, -3, DATEADD(yy, DATEDIFF(yy, 0, DATEADD(YEAR, -1, GETDATE())), 0))), 0) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.