instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
how patient 018-81471 was admitted to hospital in 2102 for the first time? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE patient (uniquepid text,patienthealthsystemstayi... | SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '018-81471' AND STRFTIME('%y', patient.hospitaladmittime) = '2102' ORDER BY patient.hospitaladmittime LIMIT 1 |
What is the GDP for the region with an area of 7,263 sq. mi.? | CREATE TABLE table_name_74 (gdp___bn__ VARCHAR,area__sq_mi_ VARCHAR) | SELECT gdp___bn__ FROM table_name_74 WHERE area__sq_mi_ = "7,263" |
how many stackexchange non-meta sites?. | CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId nu... | SELECT COUNT(name) FROM sys.databases WHERE (NOT name LIKE '%.Meta' OR name = 'StackExchange.Meta') AND database_id > 5 |
What is the pick for Mickey Johnson with fewer than 4 rounds? | CREATE TABLE table_name_19 (pick INTEGER,player VARCHAR,round VARCHAR) | SELECT SUM(pick) FROM table_name_19 WHERE player = "mickey johnson" AND round < 4 |
How many teams have a combination classification of Alejandro Valverde and a Points classification of Alessandro Petacchi? | CREATE TABLE table_19835 ("Stage" real,"Winner" text,"General classification" text,"Points classification" text,"Mountains classification" text,"Combination classification" text,"Team classification" text) | SELECT COUNT("Team classification") FROM table_19835 WHERE "Combination classification" = 'Alejandro Valverde' AND "Points classification" = 'Alessandro Petacchi' |
If Adam Voges had less than 28.5 Ovrs, what are his highest Wkts? | CREATE TABLE table_68106 ("Player" text,"Wkts" real,"Runs" real,"Econ" real,"Ovrs" real) | SELECT MAX("Wkts") FROM table_68106 WHERE "Ovrs" < '28.5' AND "Player" = 'adam voges' |
provide the number of patients whose lab test fluid is other body fluid and were admitted before the year 2111. | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2111" AND lab.fluid = "Other Body Fluid" |
What is the April 14 rank when the Mar 3rd is nr, and the April 21 is 13? | CREATE TABLE table_name_78 (april_14 VARCHAR,mar_3 VARCHAR,april_21 VARCHAR) | SELECT april_14 FROM table_name_78 WHERE mar_3 = "nr" AND april_21 = "13" |
Top 150 users from bulgaria. | CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDa... | SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Bulgaria%' OR Location LIKE '%sofia%' ORDER BY Reputation DESC LIMIT 150 |
What leading man earlier than 1932 was directed by archie mayo? | CREATE TABLE table_51407 ("Year" real,"Film" text,"Role" text,"Leading Man" text,"Director" text) | SELECT "Leading Man" FROM table_51407 WHERE "Year" < '1932' AND "Director" = 'archie mayo' |
What is the Height of the Player with a Date of Birth of 1979-06-12? | CREATE TABLE table_58906 ("Name" text,"Pos." text,"Height" text,"Weight" text,"Date of Birth" text,"Club" text) | SELECT "Height" FROM table_58906 WHERE "Date of Birth" = '1979-06-12' |
congestive heart failure or valvular heart disease ( as a known prior diagnosis or in the judgment of the managing clinician ) | CREATE TABLE table_train_69 ("id" int,"systolic_blood_pressure_sbp" int,"language" string,"valvular_dysfunction" bool,"heart_disease" bool,"temperature" float,"sepsis" bool,"heart_rate" int,"lipid_metabolism" bool,"organ_failure" bool,"NOUSE" float) | SELECT * FROM table_train_69 WHERE heart_disease = 1 OR valvular_dysfunction = 1 |
Give the total money requested by entrepreneurs who are taller than 1.85. | CREATE TABLE entrepreneur (entrepreneur_id number,people_id number,company text,money_requested number,investor text)CREATE TABLE people (people_id number,name text,height number,weight number,date_of_birth text) | SELECT SUM(T1.money_requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T2.height > 1.85 |
Please tell the revenues of the companies with the highest revenues in each headquarter city, and could you sort by the X in asc? | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT Headquarter, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY Headquarter |
Who is the Pick 7 player? | CREATE TABLE table_name_59 (player VARCHAR,pick VARCHAR) | SELECT player FROM table_name_59 WHERE pick = "7" |
Which Dist (f) has a Race of irish derby? | CREATE TABLE table_79627 ("Race" text,"Dist (f)" real,"Course" text,"Class" text,"Prize (\u00a3K)" real,"Odds" text,"Runners" real,"Placing" real,"Margin" text,"Time" text,"Jockey" text,"Trainer" text) | SELECT "Dist (f)" FROM table_79627 WHERE "Race" = 'irish derby' |
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the sum of code , and group by attribute name, sort in asc by the bars. | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name |
when did patient 83182 last get diagnosed with need prphyl vc vrl hepat during the current hospital visit? | 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 TABLE d_labitems (row_id number,itemid number,label text)CREATE TABL... | SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'need prphyl vc vrl hepat') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83182 AND admissi... |
List the dates and vote percents of elections. Show bar chart. | CREATE TABLE representative (Representative_ID int,Name text,State text,Party text,Lifespan text)CREATE TABLE election (Election_ID int,Representative_ID int,Date text,Votes real,Vote_Percent real,Seats real,Place real) | SELECT Date, Vote_Percent FROM election |
What is the name of teh studio that created the most films? | CREATE TABLE film (film_id number,title text,studio text,director text,gross_in_dollar number)CREATE TABLE film_market_estimation (estimation_id number,low_estimate number,high_estimate number,film_id number,type text,market_id number,year number)CREATE TABLE market (market_id number,country text,number_cities number) | SELECT studio FROM film GROUP BY studio ORDER BY COUNT(*) DESC LIMIT 1 |
Visualize a bar chart for the number of trains for each station by the station network name, rank in asc by the X. | CREATE TABLE weekly_weather (station_id int,day_of_week text,high_temperature int,low_temperature int,precipitation real,wind_speed_mph int)CREATE TABLE train (id int,train_number int,name text,origin text,destination text,time text,interval text)CREATE TABLE route (train_id int,station_id int)CREATE TABLE station (id ... | SELECT network_name, COUNT(*) FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id GROUP BY t2.station_id ORDER BY network_name |
count the number of patients whose ethnicity is asian and admission year is less than 2112? | 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 diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.admityear < "2112" |
What is the average room count of the apartments whose booking status code is 'Provisional'? | CREATE TABLE apartment_facilities (apt_id number,facility_code text)CREATE TABLE apartment_bookings (apt_booking_id number,apt_id number,guest_id number,booking_status_code text,booking_start_date time,booking_end_date time)CREATE TABLE apartments (apt_id number,building_id number,apt_type_code text,apt_number text,bat... | SELECT AVG(room_count) FROM apartment_bookings AS T1 JOIN apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Provisional" |
when was patient 021-79544 for the last time prescribed a medication via the sl route on the current hospital encounter? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-79544' AND patient.hospitaldischargetime IS NULL)) AND med... |
Tell me the branding for frequency of 680 khz | CREATE TABLE table_31966 ("Calls" text,"Frequency" text,"Branding" text,"Format" text,"Timeslot" text,"Group owner" text) | SELECT "Branding" FROM table_31966 WHERE "Frequency" = '680 khz' |
What is the Date with an Opponent that is hearts? | CREATE TABLE table_7186 ("Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real) | SELECT "Date" FROM table_7186 WHERE "Opponent" = 'hearts' |
What are the different software platforms for devices, and how many devices have each. | CREATE TABLE stock (Shop_ID int,Device_ID int,Quantity int)CREATE TABLE shop (Shop_ID int,Shop_Name text,Location text,Open_Date text,Open_Year int)CREATE TABLE device (Device_ID int,Device text,Carrier text,Package_Version text,Applications text,Software_Platform text) | SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform |
What is the courtesy title of the person whose tenure goes from 1766 1794? | CREATE TABLE table_name_1 (courtesy_title VARCHAR,tenure VARCHAR) | SELECT courtesy_title FROM table_name_1 WHERE tenure = "1766–1794" |
how many patients whose admission type is elective and year of birth is less than 2078? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.dob_year < "2078" |
For those employees who did not have any job in the past, visualize a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, and could you rank in ascending by the y-axis? | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))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 employees (EM... | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) |
What is the first electedfor district ohio 18 | CREATE TABLE table_1342249_35 (first_elected VARCHAR,district VARCHAR) | SELECT first_elected FROM table_1342249_35 WHERE district = "Ohio 18" |
Who was the winner during the 2009 season? | CREATE TABLE table_name_42 (winner VARCHAR,season VARCHAR) | SELECT winner FROM table_name_42 WHERE season = 2009 |
among the patients of age 40s , what was the top five most frequent procedure? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)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,... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... |
Who was the girl on week 5 that came after week 3's Mikaela James? | CREATE TABLE table_name_72 (week_5 VARCHAR,week_3 VARCHAR) | SELECT week_5 FROM table_name_72 WHERE week_3 = "mikaela james" |
Performer 1 of Stephen Frost, and a Performer 2 of Josie Lawrence, and a Date of 15 September 1995 is what performer 3? | CREATE TABLE table_name_79 (performer_3 VARCHAR,date VARCHAR,performer_1 VARCHAR,performer_2 VARCHAR) | SELECT performer_3 FROM table_name_79 WHERE performer_1 = "stephen frost" AND performer_2 = "josie lawrence" AND date = "15 september 1995" |
My Top-ranked comments >= 5 since 1/1/2019. The 50 highest ranked comments with post links | CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)... | SELECT PostId AS "post_link", Score, Text FROM Comments WHERE UserId = @UserId AND Score >= 5 AND CreationDate > '1/1/2019' ORDER BY Score LIMIT 2500 |
What opponent was in the match that resulted in 1-2? | CREATE TABLE table_14616 ("Round" text,"Date and time" text,"Opponent team" text,"Home/Away" text,"Result" text) | SELECT "Opponent team" FROM table_14616 WHERE "Result" = '1-2' |
Questions with RAW tag at first revision and no RAW tag now. | CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number... | SELECT Posts.Id AS "post_link", Posts.Tags, PostInits.Text AS "initial_tags", Posts.CreationDate FROM Posts INNER JOIN (SELECT PostId, Text FROM PostHistory WHERE PostHistoryTypeId = 3 AND Text LIKE '%rules-as-written%') AS PostInits ON Posts.Id = PostInits.PostId WHERE NOT Posts.Tags LIKE '%rules-as-written%' AND (DAT... |
For the nationality of FIN and the points of 418.8 what is the overall wc points? | CREATE TABLE table_19330 ("Rank" real,"Name" text,"Nationality" text,"1st (m)" text,"2nd (m)" text,"Points" text,"Overall WC points (Rank)" text) | SELECT "Overall WC points (Rank)" FROM table_19330 WHERE "Nationality" = 'FIN' AND "Points" = '418.8' |
Successes smaller than 6, and Launches larger than 1, and a Failures of 2 is what sum of the partial failures? | CREATE TABLE table_36413 ("Country" text,"Launches" real,"Successes" real,"Failures" real,"Partial failures" real) | SELECT SUM("Partial failures") FROM table_36413 WHERE "Successes" < '6' AND "Launches" > '1' AND "Failures" = '2' |
What is Label, when Format is Double CD? | CREATE TABLE table_48241 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text) | SELECT "Label" FROM table_48241 WHERE "Format" = 'double cd' |
find out the number of patients with lab test item id 50994. | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50994" |
List the number of cores for ddr3-1333 with frequencies between 2.66-2.8ghz. | CREATE TABLE table_73606 ("Code name" text,"Brand name" text,"Model (list)" text,"Frequency" text,"Cores/Threads" text,"Max Memory Speed" text) | SELECT "Cores/Threads" FROM table_73606 WHERE "Max Memory Speed" = 'DDR3-1333' AND "Frequency" = '2.66-2.8GHz' |
Is it true that all upper level classes are 14 credits ? | CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits var... | SELECT COUNT(*) = 0 FROM course, program_course WHERE course.credits <> 14 AND course.department = 'EECS' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id |
When 30% is scott mcadams (d) percentage how many poll sources are there? | CREATE TABLE table_23763 ("Poll source" text,"Dates administered" text,"Joe Miller (R)" text,"Lisa Murkowski (R) write-in candidate *" text,"Scott McAdams (D)" text) | SELECT COUNT("Poll source") FROM table_23763 WHERE "Scott McAdams (D)" = '30%' |
What Viewers (m) has an Episode of 40 days? | CREATE TABLE table_name_64 (viewers__m_ VARCHAR,episode VARCHAR) | SELECT viewers__m_ FROM table_name_64 WHERE episode = "40 days" |
Who was the constructor of the car driven by Heikki Kovalainen? | CREATE TABLE table_name_39 (constructor VARCHAR,driver VARCHAR) | SELECT constructor FROM table_name_39 WHERE driver = "heikki kovalainen" |
how many of the male patients had icd9 code 51889? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.icd9_code = "51889" |
Rome is in which country? | CREATE TABLE table_14903081_1 (country VARCHAR,location VARCHAR) | SELECT country FROM table_14903081_1 WHERE location = "Rome" |
What years were the inactive North Carolina chapter active? | CREATE TABLE table_name_15 (charter_range VARCHAR,status VARCHAR,state VARCHAR) | SELECT charter_range FROM table_name_15 WHERE status = "inactive" AND state = "north carolina" |
keyphrases used by torlak at popl or pldi | CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE field (fieldid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE cite (... | SELECT DISTINCT paperkeyphrase.keyphraseid FROM author, paper, paperkeyphrase, venue, writes WHERE author.authorname = 'torlak' AND paper.paperid = paperkeyphrase.paperid AND venue.venueid = paper.venueid AND venue.venuename IN ('popl', 'pldi') AND writes.authorid = author.authorid AND writes.paperid = paper.paperid |
What is Tournament, when Date is 'Sep 25, 1977'? | CREATE TABLE table_49616 ("Date" text,"Tournament" text,"Winning score" text,"Margin of victory" text,"Runner(s)-up" text) | SELECT "Tournament" FROM table_49616 WHERE "Date" = 'sep 25, 1977' |
Schema of Stack Exchange data dump. http://meta.stackexchange.com/questions/287120/schema-of-stack-exchange-data-dump | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased bo... | SELECT * FROM Posts WHERE PostTypeId = 6 AND CreationDate BETWEEN '2014-02-10' AND '2014-02-25' |
how many patients diagnosed with long term use of steroids were admitted in emergency? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.short_title = "Long-term use steroids" |
Show the names of all the donors except those whose donation amount less than 9. | CREATE TABLE budget (school_id number,year number,budgeted number,total_budget_percent_budgeted number,invested number,total_budget_percent_invested number,budget_invested_percent text)CREATE TABLE endowment (endowment_id number,school_id number,donator_name text,amount number)CREATE TABLE school (school_id text,school... | SELECT donator_name FROM endowment EXCEPT SELECT donator_name FROM endowment WHERE amount < 9 |
What location did Sherry Middaugh win in? | CREATE TABLE table_name_13 (location VARCHAR,winning_skip VARCHAR) | SELECT location FROM table_name_13 WHERE winning_skip = "sherry middaugh" |
count the number of patients who received arterial catheterization within 2 months after a diagnosis of malfunc cardiac pacemake since 3 years ago. | 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 chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum ... | 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 = 'malfunc cardiac pa... |
Which Date has a Record of 58 10? | CREATE TABLE table_35944 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Record" text) | SELECT "Date" FROM table_35944 WHERE "Record" = '58–10' |
What is the 2008 Candidates Elected before 1994 with Incumbent Jim McDermott? | CREATE TABLE table_39842 ("District" text,"Incumbent" text,"Party" text,"Elected" real,"Status" text,"2008 Candidates" text,"Results" text) | SELECT "2008 Candidates" FROM table_39842 WHERE "Elected" < '1994' AND "Incumbent" = 'jim mcdermott' |
How many silvers for south korea with under 1 gold medal? | CREATE TABLE table_name_15 (silver INTEGER,nation VARCHAR,gold VARCHAR) | SELECT MAX(silver) FROM table_name_15 WHERE nation = "south korea" AND gold < 1 |
How many episodes had 16.03 million viewers? | CREATE TABLE table_16440 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (millions)" text) | SELECT COUNT("No. in series") FROM table_16440 WHERE "U.S. viewers (millions)" = '16.03' |
When ends won were below 57 but stolen ends are more than 14, what's the highest blank ends found? | CREATE TABLE table_name_53 (blank_ends INTEGER,stolen_ends VARCHAR,ends_won VARCHAR) | SELECT MAX(blank_ends) FROM table_name_53 WHERE stolen_ends > 14 AND ends_won < 57 |
what is the name of the drug that patient 30296 had been prescribed two times in 05/this year? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)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,a... | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30296) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 ye... |
how many times was desmopressin nasal prescribed since 2 years ago? | 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 procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,chartti... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'desmopressin nasal' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-2 year') |
For those records from the products and each product's manufacturer, give me the comparison about the average of code over the name , and group by attribute name, I want to list in asc by the Y. | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code |
what was the name of the drug patient 25696 was prescribed for during the same hospital visit after having undergone a cont inv mec ven <96 hrs procedure in 03/last year? | 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 TABLE inputevents_cv (row_id number,subject_id number,hadm_id number... | SELECT t2.drug 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 admissions.subject_id = 25696 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce... |
Which Nationality of the person has a Position on left wing? | CREATE TABLE table_35083 ("Round" real,"Player" text,"Position" text,"Nationality" text,"College/Junior/Club Team (League)" text) | SELECT "Nationality" FROM table_35083 WHERE "Position" = 'left wing' |
Which Away team score has a Venue of kardinia park? | CREATE TABLE table_77975 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team score" FROM table_77975 WHERE "Venue" = 'kardinia park' |
How many total rounds did Damon Hill come in First Place? | CREATE TABLE table_185 ("Round" real,"Grand Prix" text,"Pole Position" text,"Fastest Lap" text,"Winning Driver" text,"Winning Constructor" text,"Report" text) | SELECT COUNT("Round") FROM table_185 WHERE "Winning Driver" = 'Damon Hill' |
Which week did the Seattle Seahawks have a record of 6-6? | CREATE TABLE table_15780 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" text) | SELECT AVG("Week") FROM table_15780 WHERE "Record" = '6-6' |
Which Time has Laps smaller than 28, and a Rider of nicky hayden? | CREATE TABLE table_name_40 (time VARCHAR,laps VARCHAR,rider VARCHAR) | SELECT time FROM table_name_40 WHERE laps < 28 AND rider = "nicky hayden" |
tell me what were the top five most common procedures of the patients in the 30s since 2100? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissio... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND STRFTIME('%y', treatment.treatmenttime) >= '2100' GROUP BY treatment.... |
Age when deleted - experimental. | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByRev... | SELECT * FROM Posts WHERE Id = 43386 |
What is the assist/pass on 2008-01-16 when the score was 2-0? | CREATE TABLE table_name_54 (assist_pass VARCHAR,date VARCHAR,score VARCHAR) | SELECT assist_pass FROM table_name_54 WHERE date = "2008-01-16" AND score = "2-0" |
What is the average total of player hale irwin, who had a t52 finish? | CREATE TABLE table_name_83 (total INTEGER,finish VARCHAR,player VARCHAR) | SELECT AVG(total) FROM table_name_83 WHERE finish = "t52" AND player = "hale irwin" |
What was the score of the game when the record was 39 21 4? | CREATE TABLE table_75879 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Score" FROM table_75879 WHERE "Record" = '39–21–4' |
what is the number of patients whose diagnoses short title is acidosis and lab test fluid is pleural? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | 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 = "Acidosis" AND lab.fluid = "Pleural" |
If Firefox is 30.45%, what is the other Mozilla amount? | CREATE TABLE table_1876262_10 (other_mozilla VARCHAR,firefox VARCHAR) | SELECT other_mozilla FROM table_1876262_10 WHERE firefox = "30.45%" |
Which finish had a win percentage that was more than 0.598 and also had less than 53 wins? | CREATE TABLE table_41440 ("Season" text,"Conference" text,"Division" text,"Finish" text,"Wins" real,"Losses" real,"Win%" real) | SELECT "Finish" FROM table_41440 WHERE "Win%" > '0.598' AND "Wins" < '53' |
give me the time at which patient with patient id 81923 was admitted to hospital. | 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 demographic.admittime FROM demographic WHERE demographic.subject_id = "81923" |
What is the Home Team Score at VFL Park? | CREATE TABLE table_name_97 (home_team VARCHAR,venue VARCHAR) | SELECT home_team AS score FROM table_name_97 WHERE venue = "vfl park" |
WHAT IS THE YEAR OF FLOETIC? | CREATE TABLE table_name_5 (year INTEGER,title VARCHAR) | SELECT SUM(year) FROM table_name_5 WHERE title = "floetic" |
Which country has the score 70-76-68-214? | CREATE TABLE table_name_71 (country VARCHAR,score VARCHAR) | SELECT country FROM table_name_71 WHERE score = "70-76-68-214" |
very much' questions. | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,W... | SELECT c.Id AS "comment_link" FROM Comments AS c WHERE c.Text LIKE '%very much%' ORDER BY c.CreationDate |
What surface has natalia gussoni as the partner? | CREATE TABLE table_42439 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponent in the final" text,"Score in the final" text) | SELECT "Surface" FROM table_42439 WHERE "Partner" = 'natalia gussoni' |
Where was the tour when jing junhong li jiawei played womens doubles? | CREATE TABLE table_30313 ("Year Location" text,"Mens Singles" text,"Womens Singles" text,"Mens Doubles" text,"Womens Doubles" text) | SELECT "Year Location" FROM table_30313 WHERE "Womens Doubles" = 'Jing Junhong Li Jiawei' |
what character did Laara sadiq play | CREATE TABLE table_38209 ("Character Name" text,"Voice Actor (Japanese)" text,"Voice Actor (English 1997 / Saban)" text,"Voice Actor (English 1998 / Pioneer)" text,"Voice Actor (English 2006 / FUNimation)" text) | SELECT "Character Name" FROM table_38209 WHERE "Voice Actor (English 1998 / Pioneer)" = 'laara sadiq' |
WHAT ARE THE BYES WITH A WIN SMALLER THAN 16, 8 LOSSES, AND AT PENSHURST, WITH AGAINST SMALLER THAN 1405? | CREATE TABLE table_12116 ("Mininera DFL" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real) | SELECT SUM("Byes") FROM table_12116 WHERE "Wins" < '16' AND "Losses" = '8' AND "Mininera DFL" = 'penshurst' AND "Against" < '1405' |
What is the size that has nickel as the metal, and one rupee as the denomination? | CREATE TABLE table_33902 ("Denomination" text,"Metal" text,"Weight" text,"Shape" text,"Size" text) | SELECT "Size" FROM table_33902 WHERE "Metal" = 'nickel' AND "Denomination" = 'one rupee' |
Which method was used when Alessio Sakara was the opponent? | CREATE TABLE table_name_38 (method VARCHAR,opponent VARCHAR) | SELECT method FROM table_name_38 WHERE opponent = "alessio sakara" |
When was the tournament in Forest Lake Country Club held? | CREATE TABLE table_25546 ("Year" real,"Dates" text,"Champion" text,"Country" text,"Score" text,"Margin of victory" text,"Tournament location" text,"Purse ($)" real,"Winners share ($)" real) | SELECT "Dates" FROM table_25546 WHERE "Tournament location" = 'Forest Lake Country Club' |
What is the fewest gold medals won by Greece? | CREATE TABLE table_name_92 (gold INTEGER,nation VARCHAR) | SELECT MIN(gold) FROM table_name_92 WHERE nation = "greece" |
Show each state and the number of addresses in each state Show bar chart, rank X in desc order. | CREATE TABLE Customer_Address_History (customer_id INTEGER,address_id INTEGER,date_from DATETIME,date_to DATETIME)CREATE TABLE Customers (customer_id INTEGER,payment_method_code VARCHAR(15),customer_number VARCHAR(20),customer_name VARCHAR(80),customer_address VARCHAR(255),customer_phone VARCHAR(80),customer_email VARC... | SELECT state_province_county, COUNT(*) FROM Addresses GROUP BY state_province_county ORDER BY state_province_county DESC |
how much is the minimum hospital bill that includes bradycardia? | 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 MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'bradycardia')) GROUP BY cost.patienthealthsy... |
who has the most publications in question answering ? | CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE venue (venueid int,venuename va... | SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM keyphrase, paper, paperkeyphrase, writes WHERE keyphrase.keyphrasename = 'question answering' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY ... |
What is the result for the game on May 27, 2006? | CREATE TABLE table_name_19 (result VARCHAR,date VARCHAR) | SELECT result FROM table_name_19 WHERE date = "may 27, 2006" |
Which totals tournament has the lowest wins and top-25 less than 4? | CREATE TABLE table_14785 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real) | SELECT MIN("Wins") FROM table_14785 WHERE "Tournament" = 'totals' AND "Top-25" < '4' |
When did the fourth episode of the season (4 1-04) first air? | CREATE TABLE table_24222929_3 (original_airdate VARCHAR,episode_number_production_number VARCHAR) | SELECT original_airdate FROM table_24222929_3 WHERE episode_number_production_number = "4 1-04" |
For those employees who was hired before 2002-06-21, give me the comparison about the sum of employee_id over the hire_date bin hire_date by weekday by a bar chart, and display from low to high by the y axis. | CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(EMPLOYEE_ID) |
What result had a time of 1:02? | CREATE TABLE table_48501 ("Result" text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Result" FROM table_48501 WHERE "Time" = '1:02' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.