instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What shows for mon 22 aug whenwed 24 aug is 19' 56.16 113.553mph?
CREATE TABLE table_31466 ("Rank" real,"Rider" text,"Sat 20 Aug" text,"Mon 22 Aug" text,"Tues 23 Aug" text,"Wed 24 Aug" text,"Thurs 25 Aug" text,"Fri 26 Aug" text)
SELECT "Mon 22 Aug" FROM table_31466 WHERE "Wed 24 Aug" = '19'' 56.16 113.553mph'
which year was he nominated for cheers : the motion picture .
CREATE TABLE table_204_787 (id number,"year" number,"category" text,"nominee(s)" text,"episode" text,"result" text)
SELECT "year" FROM table_204_787 WHERE "episode" = '"cheers: the motion picture"'
give the number of patients whose diagnosis icd9 code is v4987.
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 text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "V4987"
how many days have elapsed since patient 6170 first received an intake of po intake on the current intensive care unit visit?
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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6170) AND icustays.outtime IS NULL) A...
Get me the drug code and route of administration for Isosorbide Dinitrate.
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital...
SELECT prescriptions.formulary_drug_cd, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Isosorbide Dinitrate"
What was the team's rcord on february 1?
CREATE TABLE table_27539535_7 (record VARCHAR,february VARCHAR)
SELECT record FROM table_27539535_7 WHERE february = 1
until 2104, when did patient 016-14220 go to the hospital for the first time?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult nu...
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '016-14220' AND STRFTIME('%y', patient.hospitaladmittime) <= '2104' ORDER BY patient.hospitaladmittime LIMIT 1
Give me the comparison about Team_ID over the All_Neutral by a bar chart, and show from low to high by the bar.
CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En...
SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY All_Neutral
TOP Stackoverflow users from Kerala with reputation higher than 200.
CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE ReviewTaskResults (Id ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%kerala%' AND Reputation >= 200 ORDER BY Reputation DESC
when did patient 9801 first had the drain out #2 jp lateral output?
CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)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 microbiologyev...
SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9801)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'drain...
All questions tagged CSS and HTML (in this order; and nothing else).
CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostTy...
SELECT Id AS "post_link", Tags, CreationDate FROM Posts WHERE PostTypeId = 1 AND Tags = '<css><html>' ORDER BY CreationDate DESC LIMIT 100
Give me the comparison about meter_100 over the meter_300 , and display in desc by the Y.
CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE stadiu...
SELECT meter_300, meter_100 FROM swimmer ORDER BY meter_100 DESC
For all employees who have the letters D or S in their first name, give me the comparison about the sum of department_id over the job_id , and group by attribute job_id, and show in descending by the X-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 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)...
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC
hypotensive requiring vasopressors
CREATE TABLE table_train_33 ("id" int,"active_infection" bool,"allergy_to_thiamine" bool,"receiving_vasopressor" bool,"liver_disease" bool,"allergy_to_vitamin_c" bool,"allergy_to_hydrocortisone" bool,"hypertension" bool,"age" float,"serum_aminotransferase_level_alt_ast" int,"NOUSE" float)
SELECT * FROM table_train_33 WHERE hypertension = 1 AND receiving_vasopressor = 1
What is the series number for the episode with production code bdf109?
CREATE TABLE table_30224 ("Series #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text)
SELECT "Series #" FROM table_30224 WHERE "Production code" = 'BDF109'
how long is a trip from PHILADELPHIA airport to downtown PHILADELPHIA
CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airlin...
SELECT DISTINCT AIRPORT_SERVICE_0.minutes_distant FROM airport, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1 WHERE airport.airport_code = AIRPORT_SERVICE_0.airport_code AND airport.airport_code = AIRPORT_SERVICE_1.airport_code AND CITY_0.city_code = AIRPORT_...
Which image is of the woman married to william iv?
CREATE TABLE table_6080 ("Image" text,"Father" text,"Birth" text,"Ceased to be Duchess" text,"Death" text,"Husband" text)
SELECT "Image" FROM table_6080 WHERE "Husband" = 'william iv'
what number of patients were diagnosed with copd and did not return to the hospital within 2 months until 2104?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,disch...
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'copd' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1) - (SELECT COUNT(DISTINCT t2.uniq...
count the number of people that died after being diagnosed with hyperpotassemia within 2 months until 2104.
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREA...
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime 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_di...
Strunk & White and Copy Editor Progress. Counts the number of edits a user has made.
CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAu...
SELECT COUNT(*) FROM Posts WHERE PostTypeId = 1 AND LastEditorUserId = @UserId AND OwnerUserId != @UserId
List the height and weight of people in descending order of height.
CREATE TABLE body_builder (body_builder_id number,people_id number,snatch number,clean_jerk number,total number)CREATE TABLE people (people_id number,name text,height number,weight number,birth_date text,birth_place text)
SELECT height, weight FROM people ORDER BY height DESC
What are the maximum and minimum sales of the companies whose industries are not 'Banking'.
CREATE TABLE buildings (id number,name text,city text,height number,stories number,status text)CREATE TABLE office_locations (building_id number,company_id number,move_in_year number)CREATE TABLE companies (id number,name text,headquarters text,industry text,sales_billion number,profits_billion number,assets_billion nu...
SELECT MAX(sales_billion), MIN(sales_billion) FROM companies WHERE industry <> "Banking"
what are the UA flights between BALTIMORE and DENVER on 8 12
CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE dual_carrier (main_airline varchar,low_flight_n...
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 = 'DENVER' AND date_day.day_number = 12 AND date_day.month_number = 8 AND d...
For all employees who have the letters D or S in their first name, show me about the correlation between salary and commission_pct in a scatter chart.
CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))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),DEPARTME...
SELECT SALARY, COMMISSION_PCT FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
What is the Name of the Building at 100 North Tampa Street?
CREATE TABLE table_61375 ("Name" text,"Street address" text,"Years as tallest" text,"Height ft (m)" text,"Floors" real)
SELECT "Name" FROM table_61375 WHERE "Street address" = '100 north tampa street'
What is the Top that has a 66-71-66=203 score and a place of t1?
CREATE TABLE table_name_23 (to_par VARCHAR,place VARCHAR,score VARCHAR)
SELECT to_par FROM table_name_23 WHERE place = "t1" AND score = 66 - 71 - 66 = 203
provide the number of patients whose age is less than 45 and procedure long title is procedure on two vessels?
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.age < "45" AND procedures.long_title = "Procedure on two vessels"
Posts with more then 1000 votes on SQA&T.
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 CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance te...
SELECT * FROM Posts AS p WHERE p.Score > 1000
Name the opponents for record of 2-1
CREATE TABLE table_24124 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Black Knights points" real,"Opponents" real,"Record" text)
SELECT "Opponents" FROM table_24124 WHERE "Record" = '2-1'
What is the Method for Brazil?
CREATE TABLE table_name_55 (method VARCHAR,location VARCHAR)
SELECT method FROM table_name_55 WHERE location = "brazil"
What is TV Companions Featured, when Author is 'William Emms'?
CREATE TABLE table_46144 ("Title" text,"Author" text,"ISBN UK" text,"ISBN US" text,"TV companions featured" text)
SELECT "TV companions featured" FROM table_46144 WHERE "Author" = 'william emms'
What is the average number of not usable satellited when there are 0 retired, and the launch failures are less than 1?
CREATE TABLE table_name_46 (not_usable INTEGER,retired VARCHAR,launch_failures VARCHAR)
SELECT AVG(not_usable) FROM table_name_46 WHERE retired = 0 AND launch_failures < 1
What is the date for home team Collingwood?
CREATE TABLE table_name_19 (date VARCHAR,home_team VARCHAR)
SELECT date FROM table_name_19 WHERE home_team = "collingwood"
What is every team with location attendance of Arco Arena 17,014?
CREATE TABLE table_27902171_5 (team VARCHAR,location_attendance VARCHAR)
SELECT team FROM table_27902171_5 WHERE location_attendance = "ARCO Arena 17,014"
what is the media debut for the asian black bear?
CREATE TABLE table_26615633_3 (media_debut VARCHAR,species VARCHAR)
SELECT media_debut FROM table_26615633_3 WHERE species = "Asian black bear"
How many starts did Hendrick motorsports have?
CREATE TABLE table_15948 ("Year" real,"Starts" real,"Wins" real,"Top 5" real,"Top 10" real,"Poles" real,"Avg. Start" text,"Avg. Finish" text,"Winnings" text,"Position" text,"Team(s)" text)
SELECT MIN("Starts") FROM table_15948 WHERE "Team(s)" = 'Hendrick Motorsports'
How many top 5s when he was on team #28/#49 jay robinson racing?
CREATE TABLE table_2561 ("Year" real,"Starts" real,"Wins" real,"Top 5" real,"Top 10" real,"Poles" real,"Avg. Start" text,"Avg. Finish" text,"Winnings" text,"Position" text,"Team(s)" text)
SELECT MAX("Top 5") FROM table_2561 WHERE "Team(s)" = '#28/#49 Jay Robinson Racing'
What team does bobby hillin jr. (r) drive a buick regal for?
CREATE TABLE table_name_8 (team VARCHAR,make VARCHAR,driver VARCHAR)
SELECT team FROM table_name_8 WHERE make = "buick regal" AND driver = "bobby hillin jr. (r)"
What is the rank for the episode that premiered on September 13, 1978?
CREATE TABLE table_name_21 (rank VARCHAR,premiere VARCHAR)
SELECT rank FROM table_name_21 WHERE premiere = "september 13, 1978"
Give me a bar chart for the total number of each position, display bars from low to high order please.
CREATE TABLE player (Player_ID int,Player text,Years_Played text,Total_WL text,Singles_WL text,Doubles_WL text,Team int)CREATE TABLE country (Country_id int,Country_name text,Capital text,Official_native_language text)CREATE TABLE team (Team_id int,Name text)CREATE TABLE match_season (Season real,Player text,Position t...
SELECT Position, COUNT(*) FROM match_season GROUP BY Position ORDER BY Position
Whta is the lowest col in m of gerlachovsk t t peak, which has an elevation greater than 2,655 m?
CREATE TABLE table_name_69 (col__m_ INTEGER,peak VARCHAR,elevation__m_ VARCHAR)
SELECT MIN(col__m_) FROM table_name_69 WHERE peak = "gerlachovský štít" AND elevation__m_ > 2 OFFSET 655
When did researchers start and stop working?
CREATE TABLE grants (grant_id number,organisation_id number,grant_amount number,grant_start_date time,grant_end_date time,other_details text)CREATE TABLE projects (project_id number,organisation_id number,project_details text)CREATE TABLE project_outcomes (project_id number,outcome_code text,outcome_details text)CREATE...
SELECT date_from, date_to FROM project_staff WHERE role_code = 'researcher'
what was the average score between matches 1 and 2 ?
CREATE TABLE table_203_675 (id number,"match" number,"date" text,"round" text,"home/away" text,"opponent team" text,"score" text,"scorers" text)
SELECT "score" FROM table_203_675 WHERE "match" = 1
Find the name and training hours of players whose hours are below 1500.
CREATE TABLE tryout (pid number,cname text,ppos text,decision text)CREATE TABLE college (cname text,state text,enr number)CREATE TABLE player (pid number,pname text,ycard text,hs number)
SELECT pname, hs FROM player WHERE hs < 1500
What is Pilot, when Weapon is '35mm fire', and when Date is '4 May 1982'?
CREATE TABLE table_name_48 (pilot VARCHAR,weapon VARCHAR,date VARCHAR)
SELECT pilot FROM table_name_48 WHERE weapon = "35mm fire" AND date = "4 may 1982"
Can you tell me the Game that has the Opponent of miami heat?
CREATE TABLE table_46779 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Record" text)
SELECT "Game" FROM table_46779 WHERE "Opponent" = 'miami heat'
what is the number of patients whose gender is f and item id is 51458?
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 lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.itemid = "51458"
when was the last time since 06/04/2103 patient 022-76925 heartrate was measured/taken?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid numbe...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-76925')) AND NOT vitalperiodic.heartrate IS NUL...
calculate the total of patient 008-46802's input until 11/07/2104.
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE medication (medicationid number,patient...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-46802')) AND intakeoutput.cellpath LIKE '%in...
What is the Kosal with a balangir town sitalsasthi carnival?
CREATE TABLE table_76556 ("Sambalpuri Cinema" text,"Kosal" text,"Western Odisha" text,"Sitalsasthi Carnival" text,"Sambalpuri Language" text,"Sambalpuri Saree" text)
SELECT "Kosal" FROM table_76556 WHERE "Sitalsasthi Carnival" = 'balangir town'
What is Rhett Mclane's highest pick number?
CREATE TABLE table_53911 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text)
SELECT MAX("Pick #") FROM table_53911 WHERE "Player" = 'rhett mclane'
Draw a pie chart about the proportion of other_details and the amount of other_details.
CREATE TABLE Student_Addresses (student_id INTEGER,address_id INTEGER,date_address_from DATETIME,date_address_to DATETIME,monthly_rental DECIMAL(19,4),other_details VARCHAR(255))CREATE TABLE Assessment_Notes (notes_id INTEGER,student_id INTEGER,teacher_id INTEGER,date_of_notes DATETIME,text_of_notes VARCHAR(255),other_...
SELECT other_details, COUNT(other_details) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
What are the average, maximum, and minimum number of floors for all buildings?
CREATE TABLE building (building_id text,name text,street_address text,years_as_tallest text,height_feet number,floors number)CREATE TABLE protein (common_name text,protein_name text,divergence_from_human_lineage number,accession_number text,sequence_length number,sequence_identity_to_human_protein text,institution_id t...
SELECT AVG(floors), MAX(floors), MIN(floors) FROM building
What is Country, when Total is less than 148, and when Player is 'Gary Player'?
CREATE TABLE table_60896 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real)
SELECT "Country" FROM table_60896 WHERE "Total" < '148' AND "Player" = 'gary player'
What is the sum of total with a Rank larger than 12, and a Gold larger than 4?
CREATE TABLE table_name_46 (total VARCHAR,rank VARCHAR,gold VARCHAR)
SELECT COUNT(total) FROM table_name_46 WHERE rank > 12 AND gold > 4
What is the sum of matches played for teams with more than 10 losses and under 5 points?
CREATE TABLE table_64391 ("Position" real,"Name" text,"Played" real,"Drawn" real,"Lost" real,"Points" real)
SELECT SUM("Played") FROM table_64391 WHERE "Lost" > '10' AND "Points" < '5'
Among patients with sigmoid diverticulitis, colovestical fistula/sda as primary disease, how many of them were born before 2073?
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 WHERE demographic.diagnosis = "SIGMOID DIVERTICULITIS, COLOVESTICAL FISTULA/SDA" AND demographic.dob_year < "2073"
Who was the director where the role was Fred Ayres?
CREATE TABLE table_name_13 (director VARCHAR,role VARCHAR)
SELECT director FROM table_name_13 WHERE role = "fred ayres"
Which publishers did not publish a book in 1989?
CREATE TABLE culture_company (company_name text,type text,incorporated_in text,group_equity_shareholding number,book_club_id text,movie_id text)CREATE TABLE movie (movie_id number,title text,year number,director text,budget_million number,gross_worldwide number)CREATE TABLE book_club (book_club_id number,year number,au...
SELECT publisher FROM book_club EXCEPT SELECT publisher FROM book_club WHERE year = 1989
When itogon, benguet is the city/municipality and 1st class is the income classification how many measurements of population in 2010?
CREATE TABLE table_29289372_1 (population__2010_ VARCHAR,income_classification VARCHAR,city_municipality VARCHAR)
SELECT COUNT(population__2010_) FROM table_29289372_1 WHERE income_classification = "1st Class" AND city_municipality = "Itogon, Benguet"
Who was the driver/passengar when the position was smaller than 8, the third was 1, and there was 1 win?
CREATE TABLE table_77034 ("Position" real,"Driver / Passenger" text,"Equipment" text,"Points" real,"Wins" text,"Second" text,"Third" text)
SELECT "Driver / Passenger" FROM table_77034 WHERE "Third" = '1' AND "Position" < '8' AND "Wins" = '1'
Count the number of patients with brain mass intracranial hemorrhage as their primary disease who were hospitalized for more than 2 days.
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND demographic.days_stay > "2"
What is the 2008 USD figure for the subject with 2849 USD in 2005?
CREATE TABLE table_26786 ("Rank (2008)" real,"Federal Subjects" text,"Russian Name" text,"2008 (RUB)" real,"2008 (USD)" real,"2007 (RUB)" real,"2007 (USD)" real,"2005 (RUB)" real,"2005 (USD)" real)
SELECT "2008 (USD)" FROM table_26786 WHERE "2005 (USD)" = '2849'
which is the previous attendance for week 10
CREATE TABLE table_204_670 (id number,"week" number,"date" text,"opponent" text,"result" text,"record" text,"attendance" number)
SELECT "attendance" FROM table_204_670 WHERE "week" = 10 - 1
What is the date of vacancy for the Liverpool team with a table named pre-season?
CREATE TABLE table_24172157_3 (date_of_vacancy VARCHAR,table VARCHAR,team VARCHAR)
SELECT date_of_vacancy FROM table_24172157_3 WHERE table = "Pre-season" AND team = "Liverpool"
What are the average net yards that have 9 as the touchdowns, 145 as the attempts, and yards per attempt greater than 4.8?
CREATE TABLE table_name_87 (net_yards INTEGER,yards_per_attempt VARCHAR,touchdowns VARCHAR,attempts VARCHAR)
SELECT AVG(net_yards) FROM table_name_87 WHERE touchdowns = 9 AND attempts = 145 AND yards_per_attempt > 4.8
Name the total number of stage for lloyd mondory
CREATE TABLE table_22713796_14 (stage VARCHAR,mountains_classification VARCHAR)
SELECT COUNT(stage) FROM table_22713796_14 WHERE mountains_classification = "Lloyd Mondory"
Find the name and hours of the students whose tryout decision is yes.
CREATE TABLE college (cname text,state text,enr number)CREATE TABLE player (pid number,pname text,ycard text,hs number)CREATE TABLE tryout (pid number,cname text,ppos text,decision text)
SELECT T1.pname, T1.hs FROM player AS T1 JOIN tryout AS T2 ON T1.pid = T2.pid WHERE T2.decision = 'yes'
how much is the average cost for a hospital that contains ciprofloxacin hcl until 2101?
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,va...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'ciprofloxacin hcl') AND STRFTIME('%y', cost.chargetime) <= '2101' GROUP BY cost.hadm_id) AS t1
Which Team has Points of 15?
CREATE TABLE table_44245 ("Fin. Pos" text,"Car No." text,"Driver" text,"Team" text,"Laps" text,"Time/Retired" text,"Grid" text,"Laps Led" text,"Points" text)
SELECT "Team" FROM table_44245 WHERE "Points" = '15'
Which service does the network of atn urdu offer?
CREATE TABLE table_33532 ("Network" text,"Origin of Programming" text,"Language" text,"Genre" text,"Service" text)
SELECT "Service" FROM table_33532 WHERE "Network" = 'atn urdu'
What is the Owner of the Frequency with a Format of First Nations Community Radio?
CREATE TABLE table_name_40 (owner VARCHAR,format VARCHAR)
SELECT owner FROM table_name_40 WHERE format = "first nations community radio"
Which event has notes of women +60kg quarterfinal?
CREATE TABLE table_name_43 (event VARCHAR,notes VARCHAR)
SELECT event FROM table_name_43 WHERE notes = "women +60kg quarterfinal"
If the PCT is 0.514, what was the minimum OTL?
CREATE TABLE table_1888165_1 (Otl INTEGER,PCt VARCHAR)
SELECT MIN(Otl) FROM table_1888165_1 WHERE PCt = 0.514
What is the Outcome when christophe rochus was partner, on 31 july 2005?
CREATE TABLE table_42721 ("Outcome" text,"Date" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text)
SELECT "Outcome" FROM table_42721 WHERE "Partner" = 'christophe rochus' AND "Date" = '31 july 2005'
how many patients were diagnosed with breast ca - female in the same hospital visit during the last year following the first diagnosis of pleural effusion?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitsta...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'breast ca - female' AND DATETIME(diagnosis.diagnosistime, 'start of year'...
what is the format of catalog 865 821-1?
CREATE TABLE table_34609 ("Date" text,"Label" text,"Region" text,"Format" text,"Catalog" text)
SELECT "Format" FROM table_34609 WHERE "Catalog" = '865 821-1'
what is the total amount of points for florencia ?
CREATE TABLE table_203_22 (id number,"draw" number,"artist" text,"song" text,"points" number,"place" text)
SELECT "points" FROM table_203_22 WHERE "artist" = 'florencia'
What shows for 2009 when 25 shows for 2011?
CREATE TABLE table_68405 ("Tournament" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text,"Win %" text)
SELECT "2009" FROM table_68405 WHERE "2011" = '25'
What's the island with a summit of Haleakal ?
CREATE TABLE table_name_74 (island VARCHAR,summit VARCHAR)
SELECT island FROM table_name_74 WHERE summit = "haleakalā"
What was the lowest heat for Germany with a rank smaller than 9 for Mike Fenner and a time smaller than 13.52?
CREATE TABLE table_name_51 (heat INTEGER,time VARCHAR,name VARCHAR,nationality VARCHAR,rank VARCHAR)
SELECT MIN(heat) FROM table_name_51 WHERE nationality = "germany" AND rank < 9 AND name = "mike fenner" AND time < 13.52
provide the number of patients whose diagnoses short title is hx tia/stroke w/o resid and drug name is warfarin?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hx TIA/stroke w/o resid" AND prescriptions.drug = "Warfarin"
Name the total number of high assists for fedexforum 11,283
CREATE TABLE table_27756474_6 (high_assists VARCHAR,location_attendance VARCHAR)
SELECT COUNT(high_assists) FROM table_27756474_6 WHERE location_attendance = "FedExForum 11,283"
What is the U.S. Christian with a Year that is 1989?
CREATE TABLE table_name_92 (us VARCHAR,year VARCHAR)
SELECT us AS Christian FROM table_name_92 WHERE year = 1989
Where did aaron wagner go to college
CREATE TABLE table_20649850_1 (college VARCHAR,player VARCHAR)
SELECT college FROM table_20649850_1 WHERE player = "Aaron Wagner"
How many dates of vacancy were on 30 october 2010?
CREATE TABLE table_29714 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Table" text,"Incoming manager" text,"Date of appointment" text)
SELECT COUNT("Team") FROM table_29714 WHERE "Date of vacancy" = '30 October 2010'
What are the first name and last name of each male member in club 'Hopkins Student Enterprises'?
CREATE TABLE club (clubid number,clubname text,clubdesc text,clublocation text)CREATE TABLE member_of_club (stuid number,clubid number,position text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)
SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" AND t3.sex = "M"
Which Player has a Position of number 8, and a Club/province of scarlets?
CREATE TABLE table_5317 ("Player" text,"Position" text,"Date of Birth (Age)" text,"Caps" real,"Club/province" text)
SELECT "Player" FROM table_5317 WHERE "Position" = 'number 8' AND "Club/province" = 'scarlets'
Which 2008 had a 1998 and 2006 that were a when 2009 was sf?
CREATE TABLE table_37949 ("Tournament" text,"1998" text,"1999" text,"2000" text,"2001" text,"2002" text,"2003" text,"2004" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text)
SELECT "2008" FROM table_37949 WHERE "1998" = 'a' AND "2009" = 'sf' AND "2006" = 'a'
Who is the opponent the Seattle Seahawks played when their record was 1-3?
CREATE TABLE table_name_57 (opponent VARCHAR,record VARCHAR)
SELECT opponent FROM table_name_57 WHERE record = "1-3"
What is the Phoneme symbol for in Nuskhuri?
CREATE TABLE table_name_43 (phoneme VARCHAR,nuskhuri VARCHAR)
SELECT phoneme FROM table_name_43 WHERE nuskhuri = "ⴥ"
Which 2007 has a 2008 of 1r, and a Tournament of wimbledon?
CREATE TABLE table_33910 ("Tournament" text,"2002" text,"2004" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text,"2013" text)
SELECT "2007" FROM table_33910 WHERE "2008" = '1r' AND "Tournament" = 'wimbledon'
What team was the away team when Footscray was the home team?
CREATE TABLE table_name_19 (away_team VARCHAR,home_team VARCHAR)
SELECT away_team FROM table_name_19 WHERE home_team = "footscray"
how many male patients had the procedure titled endosc destr stomach les?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.short_title = "Endosc destr stomach les"
Which Date has a Score of 4 5, and a Game smaller than 4?
CREATE TABLE table_75255 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Series" text)
SELECT "Date" FROM table_75255 WHERE "Score" = '4–5' AND "Game" < '4'
what team had a score of 2-1
CREATE TABLE table_37260 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Save" text)
SELECT "Opponent" FROM table_37260 WHERE "Score" = '2-1'
Do I earn 18 credits for the upper-level classes ?
CREATE TABLE area (course_id int,area varchar)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE gsi (course_offering_id in...
SELECT COUNT(*) = 0 FROM course, program_course WHERE course.credits <> 18 AND course.department = 'EECS' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
What is the zone of the game played against Estonia?
CREATE TABLE table_56733 ("Edition" real,"Zone" text,"Round" text,"Date" text,"Against" text,"Surface" text,"Partner" text,"Opponents" text,"Result" text)
SELECT "Zone" FROM table_56733 WHERE "Against" = 'estonia'
Return the name of each physician and the number of patients he or she treats in a bar chart, list by the total number from low to high.
CREATE TABLE Appointment (AppointmentID INTEGER,Patient INTEGER,PrepNurse INTEGER,Physician INTEGER,Start DATETIME,End DATETIME,ExaminationRoom TEXT)CREATE TABLE Procedures (Code INTEGER,Name VARCHAR(30),Cost REAL)CREATE TABLE Physician (EmployeeID INTEGER,Name VARCHAR(30),Position VARCHAR(30),SSN INTEGER)CREATE TABLE ...
SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID ORDER BY COUNT(*)
What team was the away team for the game with 916 in attendance?
CREATE TABLE table_46562 ("Date" text,"Home" text,"Score" text,"Away" text,"Attendance" real)
SELECT "Away" FROM table_46562 WHERE "Attendance" = '916'