instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What Hometown/School had a pick above 30, position of OF and team of Cleveland Indians?
CREATE TABLE table_62314 ("Pick" real,"Player" text,"Team" text,"Position" text,"Hometown/School" text)
SELECT "Hometown/School" FROM table_62314 WHERE "Pick" > '30' AND "Position" = 'of' AND "Team" = 'cleveland indians'
What is the lowest number of bronze medals for a nation with fewer than 1 total medal?
CREATE TABLE table_name_87 (bronze INTEGER,total INTEGER)
SELECT MIN(bronze) FROM table_name_87 WHERE total < 1
what was patient 017-24595's weight the last time in 07/this year?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime ti...
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-24595') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-...
Show the names of phones that are on market with number of shops greater than 50.
CREATE TABLE phone_market (Market_ID VARCHAR,Phone_ID VARCHAR)CREATE TABLE market (Market_ID VARCHAR,Num_of_shops INTEGER)CREATE TABLE phone (Name VARCHAR,Phone_ID VARCHAR)
SELECT T3.Name FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID WHERE T2.Num_of_shops > 50
What was the record after the bout lasting 4:15?
CREATE TABLE table_36509 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text)
SELECT "Record" FROM table_36509 WHERE "Time" = '4:15'
posts tagged excel or vba.
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 PostLinks (Id number,CreationDate time,PostId number,RelatedPos...
SELECT COUNT(Id) AS num FROM Posts WHERE Tags LIKE '%vba%' OR Tags LIKE '%excel%'
provide the number of patients whose diagnoses long title is hyperacusis and lab test category is blood gas?
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 demographic (subject_id text,hadm_id text,name text,marita...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Hyperacusis" AND lab."CATEGORY" = "Blood Gas"
What's the sum of swing to gain with a winning party 2007 of Conservative with a rank smaller than 5?
CREATE TABLE table_name_70 (swing_to_gain INTEGER,winning_party_2007 VARCHAR,rank VARCHAR)
SELECT SUM(swing_to_gain) FROM table_name_70 WHERE winning_party_2007 = "conservative" AND rank < 5
What is the total number of avg/g with a long of 50, a gp-gs of 3-0, and 926 yards?
CREATE TABLE table_7074 ("Name" text,"GP-GS" text,"Yards" real,"Long" real,"Avg/G" real)
SELECT COUNT("Avg/G") FROM table_7074 WHERE "Long" = '50' AND "GP-GS" = '3-0' AND "Yards" > '926'
What is the name of the venue that they away team Collingwood played at?
CREATE TABLE table_55165 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Venue" FROM table_55165 WHERE "Away team" = 'collingwood'
What numbered episode was directed by greg colton and written by patrick meighan?
CREATE TABLE table_30402 ("# (season #)" text,"No. (episode #)" text,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Prod. code" text)
SELECT "No. (episode #)" FROM table_30402 WHERE "Directed by" = 'Greg Colton' AND "Written by" = 'Patrick Meighan'
What is the 1991 for 2R 1999?
CREATE TABLE table_60357 ("Tournament" text,"1988" text,"1990" text,"1991" text,"1992" text,"1993" text,"1995" text,"1996" text,"1997" text,"1998" text,"1999" text,"2000" text,"2001" text,"Career SR" text,"Career Win-Loss" text)
SELECT "1991" FROM table_60357 WHERE "1999" = '2r'
How many users provide all accepted answers in the last year in the given tag.
CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE Posts (Id number,PostTyp...
SELECT COUNT(DISTINCT a.OwnerUserId) AS "distinct_users", COUNT(DISTINCT a.OwnerUserId) * 1.0 / COUNT(DISTINCT a.Id) AS "ratio", COUNT(a.Id) AS "accepted_answers", t.TagName, CURRENT_TIMESTAMP() - 366 AS "year_ago" FROM Posts AS q INNER JOIN Posts AS a ON q.AcceptedAnswerId = a.Id JOIN PostTags AS pt ON pt.PostId = q.I...
what is the first care unit of patient 73713 during this year?
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 procedures_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_...
SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73713) AND NOT transfers.careunit IS NULL AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY transfers.intime LIMIT 1
List the physicians' employee ids together with their primary affiliation departments' ids.
CREATE TABLE procedures (code number,name text,cost number)CREATE TABLE stay (stayid number,patient number,room number,staystart time,stayend time)CREATE TABLE physician (employeeid number,name text,position text,ssn number)CREATE TABLE appointment (appointmentid number,patient number,prepnurse number,physician number,...
SELECT physician, department FROM affiliated_with WHERE primaryaffiliation = 1
how long did the lumber exchange building stand as the tallest building ?
CREATE TABLE table_203_105 (id number,"name" text,"street address" text,"years as tallest" text,"height\nft (m)" text,"floors" number)
SELECT "years as tallest" - "years as tallest" FROM table_203_105 WHERE "name" = 'lumber exchange building'
Date for less than 122 countries and a 47% rank?
CREATE TABLE table_44415 ("Overall ranking" text,"Lat. Am. ranking" text,"Countries surveyed" real,"% rank." text,"Date" text)
SELECT "Date" FROM table_44415 WHERE "Countries surveyed" < '122' AND "% rank." = '47'
since 2105, what are the top five most frequently ordered laboratory tests for patients within 2 months after they have been diagnosed with cholangiocarcinoma?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstay...
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cholangiocarcinoma' AND STRFTIME('%y', diagnosis.dia...
What were highest points received from someone using a zabel-wsp with a position greater than 7?
CREATE TABLE table_name_15 (points INTEGER,equipment VARCHAR,position VARCHAR)
SELECT MAX(points) FROM table_name_15 WHERE equipment = "zabel-wsp" AND position > 7
Which Decision has a Visitor of vancouver, and a Score of 5 4?
CREATE TABLE table_46386 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Series" text)
SELECT "Decision" FROM table_46386 WHERE "Visitor" = 'vancouver' AND "Score" = '5 – 4'
Visualize a bar chart about the distribution of meter_300 and meter_100 , list total number in ascending order.
CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)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 record (ID int,Result text,Swimmer_ID int,Ev...
SELECT meter_300, meter_100 FROM swimmer ORDER BY meter_100
What is the smallest finish time for a race after 1972 with a car manufactured by pontiac?
CREATE TABLE table_name_69 (finish INTEGER,year VARCHAR,manufacturer VARCHAR)
SELECT MIN(finish) FROM table_name_69 WHERE year > 1972 AND manufacturer = "pontiac"
Which Topinka happened on january 22, 2006?
CREATE TABLE table_name_11 (topinka__r_ VARCHAR,date VARCHAR)
SELECT topinka__r_ FROM table_name_11 WHERE date = "january 22, 2006"
Name the opponent for 4th
CREATE TABLE table_21346 ("Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real,"Competition" text,"Man of the Match" text)
SELECT "Opponent" FROM table_21346 WHERE "Date" = '4th'
Which player had a total of 152?
CREATE TABLE table_7564 ("Player" text,"Country" text,"Year(s) won" text,"Total" text,"To par" text)
SELECT "Player" FROM table_7564 WHERE "Total" = '152'
What was the location and attendance at the game when the record was 9-6?
CREATE TABLE table_66050 ("Game" text,"Date" text,"Opponent" text,"Score" text,"Location/Attendance" text,"Record" text)
SELECT "Location/Attendance" FROM table_66050 WHERE "Record" = '9-6'
Which nation won the boxing championship in 2012?
CREATE TABLE table_name_1 (nation_represented VARCHAR,year VARCHAR)
SELECT nation_represented FROM table_name_1 WHERE year = 2012
who released the most songs ?
CREATE TABLE table_204_680 (id number,"released" text,"title" text,"artist" text,"format" text,"language" text)
SELECT "artist" FROM table_204_680 GROUP BY "artist" ORDER BY COUNT("title") DESC LIMIT 1
What is the 2006 population of the area with vehicle registration code of G and population density of 1,432.0?
CREATE TABLE table_8079 ("County or City" text,"NUTS 3 Region" text,"Population (2006)" text,"Area (km\u00b2)" text,"Population Density" text,"Principal town/city" text,"Vehicle Registration Code" text)
SELECT "Population (2006)" FROM table_8079 WHERE "Vehicle Registration Code" = 'g' AND "Population Density" = '1,432.0'
what is the number of patients whose ethnicity is white and diagnoses icd9 code is 7847?
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.ethnicity = "WHITE" AND diagnoses.icd9_code = "7847"
who has the high points on june 16?
CREATE TABLE table_name_53 (high_points VARCHAR,date VARCHAR)
SELECT high_points FROM table_name_53 WHERE date = "june 16"
What is the sum of t ( m), when Technology is MJ?
CREATE TABLE table_name_26 (t__µm_ INTEGER,technology VARCHAR)
SELECT SUM(t__µm_) FROM table_name_26 WHERE technology = "mj"
What is the years at the club of the player with 2 goals and was born on 23 July 1910?
CREATE TABLE table_77670 ("Debut year" real,"Player" text,"Date of birth" text,"Games" real,"Goals" real,"Years at club" text)
SELECT "Years at club" FROM table_77670 WHERE "Goals" = '2' AND "Date of birth" = '23 july 1910'
Tell me the number of female patients who had replacement of tube or enterostomy device of the small intestine.
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.long_title = "Replacement of tube or enterostomy device of small intestine"
What title episode did Paris Barclay direct?
CREATE TABLE table_23852 ("No. in series" real,"Title" text,"Directedby" text,"Writtenby" text,"Originalairdate" text,"Production code" text)
SELECT "Title" FROM table_23852 WHERE "Directedby" = 'Paris Barclay'
What is Player, when To Par is less than 14?
CREATE TABLE table_48344 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real,"Finish" text)
SELECT "Player" FROM table_48344 WHERE "To par" < '14'
What is the highest lost?
CREATE TABLE table_26677836_1 (lost INTEGER)
SELECT MAX(lost) FROM table_26677836_1
Show the number of type of thing code from each type of thing code, and could you rank Type_of_Thing_Code from low to high order?
CREATE TABLE Residents (resident_id INTEGER,property_id INTEGER,date_moved_in DATETIME,date_moved_out DATETIME,other_details VARCHAR(255))CREATE TABLE Organizations (organization_id INTEGER,parent_organization_id INTEGER,organization_details VARCHAR(255))CREATE TABLE Customer_Event_Notes (Customer_Event_Note_ID INTEGER...
SELECT Type_of_Thing_Code, COUNT(Type_of_Thing_Code) FROM Things GROUP BY Type_of_Thing_Code ORDER BY Type_of_Thing_Code
What is the 2010 of the Grand Slam Tournaments in 2011?
CREATE TABLE table_43076 ("Tournament" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text)
SELECT "2010" FROM table_43076 WHERE "2011" = 'grand slam tournaments'
Find the number of medications prescribed for each brand Plot them as bar chart, order from low to high by the X-axis please.
CREATE TABLE Procedures (Code INTEGER,Name VARCHAR(30),Cost REAL)CREATE TABLE Room (RoomNumber INTEGER,RoomType VARCHAR(30),BlockFloor INTEGER,BlockCode INTEGER,Unavailable BOOLEAN)CREATE TABLE Undergoes (Patient INTEGER,Procedures INTEGER,Stay INTEGER,DateUndergoes DATETIME,Physician INTEGER,AssistingNurse INTEGER)CRE...
SELECT Name, COUNT(*) FROM Medication AS T1 JOIN Prescribes AS T2 ON T1.Code = T2.Medication GROUP BY T1.Brand ORDER BY Name
What club does Manuel Fernandes coach?
CREATE TABLE table_name_88 (club VARCHAR,head_coach VARCHAR)
SELECT club FROM table_name_88 WHERE head_coach = "manuel fernandes"
What is the 1998 value if the 2011 value is 30.4?
CREATE TABLE table_name_86 (Id VARCHAR)
SELECT 1998 FROM table_name_86 WHERE 2011 = "30.4"
What is the loss when the record is 38-33?
CREATE TABLE table_name_67 (loss VARCHAR,record VARCHAR)
SELECT loss FROM table_name_67 WHERE record = "38-33"
What years did the player with a total larger than 157 have wins?
CREATE TABLE table_59210 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real)
SELECT "Year(s) won" FROM table_59210 WHERE "Total" > '157'
What is the character name that has phyllis welch as the leading lady?
CREATE TABLE table_name_97 (character_name VARCHAR,leading_lady VARCHAR)
SELECT character_name FROM table_name_97 WHERE leading_lady = "phyllis welch"
What is the lowest population total in La Romana when the area is less than 1,788.4, the density is greater than 234.77, and a rank greater than 30
CREATE TABLE table_42664 ("Rank" real,"Province" text,"Population" real,"Area" real,"Density" real)
SELECT MIN("Population") FROM table_42664 WHERE "Area" < '1,788.4' AND "Density" > '234.77' AND "Province" = 'la romana' AND "Rank" > '30'
What is the thurs 25 aug when wed 24 aug is 19' 59.73 113.216mph?
CREATE TABLE table_30058355_2 (thurs_25_aug VARCHAR,wed_24_aug VARCHAR)
SELECT thurs_25_aug FROM table_30058355_2 WHERE wed_24_aug = "19' 59.73 113.216mph"
What is Brendan Locke's College/Junior/Club Team (League)?
CREATE TABLE table_38785 ("Round" text,"Player" text,"Position" text,"Nationality" text,"College/Junior/Club Team (League)" text)
SELECT "College/Junior/Club Team (League)" FROM table_38785 WHERE "Player" = 'brendan locke'
tell me the difference between the total amount of input and output from patient 31880 on 01/05/last year?
CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)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 microbio...
SELECT (SELECT SUM(inputevents_cv.amount) 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 = 31880)) AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT...
Name the platforms for cityengine
CREATE TABLE table_23033 ("Application" text,"Latest release date and version" text,"Developed by" text,"Platforms" text,"Mainly Used For" text,"License" text)
SELECT "Platforms" FROM table_23033 WHERE "Application" = 'CityEngine'
What is the percentage for Mel Martinez when the sample size is 800?
CREATE TABLE table_name_6 (mel_martinez__r_ VARCHAR,sample_size VARCHAR)
SELECT mel_martinez__r_ FROM table_name_6 WHERE sample_size = 800
who was the main presenter previous to barbara d'urso ?
CREATE TABLE table_203_397 (id number,"series" text,"launch date" text,"finale date" text,"days" number,"housemates" number,"winner" text,"main presenter" text,"grand prize" text,"liveshow\naudience\nmillions" number)
SELECT "main presenter" FROM table_203_397 WHERE "launch date" < (SELECT "launch date" FROM table_203_397 WHERE "main presenter" = "barbara d'urso") ORDER BY "launch date" DESC LIMIT 1
What date is the Victoria Park venue?
CREATE TABLE table_54878 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Date" text)
SELECT "Date" FROM table_54878 WHERE "Venue" = 'victoria park'
when was the first time on 04/05/2103 that patient 027-64792 had his or her heartrate measured?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage tex...
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 = '027-64792')) AND NOT vitalperiodic.heartrate IS NUL...
how many days have elapsed since the time patient 005-4471 was admitted to the icu?
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE patient (uniquepid ...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '005-4471' AND patient.unitdischargetime IS NULL
Give me a bar chart showing the number of customers who has an account for each customer last name, I want to display in ascending by the y-axis.
CREATE TABLE Financial_Transactions (transaction_id INTEGER,previous_transaction_id INTEGER,account_id INTEGER,card_id INTEGER,transaction_type VARCHAR(15),transaction_date DATETIME,transaction_amount DOUBLE,transaction_comment VARCHAR(255),other_transaction_details VARCHAR(255))CREATE TABLE Accounts (account_id INTEGE...
SELECT customer_last_name, COUNT(customer_last_name) FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id GROUP BY customer_last_name ORDER BY COUNT(customer_last_name)
how long did ian armstrong serve ?
CREATE TABLE table_202_76 (id number,"member" text,"party" text,"term" text)
SELECT "term" - "term" FROM table_202_76 WHERE "member" = 'ian armstrong'
What nationality is the forward/center position?
CREATE TABLE table_50297 ("Player" text,"Nationality" text,"Position" text,"Years for Grizzlies" text,"School/Club Team" text)
SELECT "Nationality" FROM table_50297 WHERE "Position" = 'forward/center'
In 2011, how many tourists visited the country that had 23.4 million tourists in 2012?
CREATE TABLE table_34549 ("Rank" real,"Country" text,"International tourist arrivals (2012)" text,"International tourist arrivals (2011)" text,"Change (2011 to 2012)" text,"Change (2010 to 2011)" text)
SELECT "International tourist arrivals (2011)" FROM table_34549 WHERE "International tourist arrivals (2012)" = '23.4 million'
how many days has it been since the first time on this hospital visit that patient 016-9636 had a procedure performed?
CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636' ...
What is the lowest year with tyres in g and less than 0 points?
CREATE TABLE table_name_32 (year INTEGER,tyres VARCHAR,points VARCHAR)
SELECT MIN(year) FROM table_name_32 WHERE tyres = "g" AND points < 0
Which Baltimore group is of the retroviridae family?
CREATE TABLE table_name_62 (baltimore_group VARCHAR,family VARCHAR)
SELECT baltimore_group FROM table_name_62 WHERE family = "retroviridae"
what is the cheapest fare one way between PITTSBURGH and DENVER
CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stops int,time_elapsed int,to_airport varchar)CREATE TABLE restriction (res...
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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c...
What is the State with Suwon as the city
CREATE TABLE table_name_37 (state VARCHAR,city VARCHAR)
SELECT state FROM table_name_37 WHERE city = "suwon"
What is the number of Years at Club for the player who has had more games than 28, more Goals than 225, and his Debut year was after 1950?
CREATE TABLE table_51683 ("Debut year" real,"Player" text,"Date of birth" text,"Games" real,"Goals" real,"Years at club" text)
SELECT "Years at club" FROM table_51683 WHERE "Games" > '28' AND "Goals" > '225' AND "Debut year" > '1950'
Who are the Runner(s)-up with a Margin of 3 strokes?
CREATE TABLE table_39384 ("Year" real,"Championship" text,"54 holes" text,"Winning score" text,"Margin" text,"Runner(s)-up" text)
SELECT "Runner(s)-up" FROM table_39384 WHERE "Margin" = '3 strokes'
Who is the driver of the team with the crew chief Derrick Finley?
CREATE TABLE table_name_16 (driver_s_ VARCHAR,crew_chief VARCHAR)
SELECT driver_s_ FROM table_name_16 WHERE crew_chief = "derrick finley"
how many riders got more than 10 points ?
CREATE TABLE table_203_718 (id number,"pos" text,"rider" text,"manufacturer" text,"time/retired" text,"points" number)
SELECT COUNT("rider") FROM table_203_718 WHERE "points" > 10
What is the record when the game was at the San Diego Stadium?
CREATE TABLE table_1783 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" real)
SELECT "Record" FROM table_1783 WHERE "Game site" = 'San Diego Stadium'
On what Date was the Opponent Panathinaikos?
CREATE TABLE table_56063 ("Round" text,"Date" text,"Opponent" text,"Score" text,"Attendance" real,"Report" text)
SELECT "Date" FROM table_56063 WHERE "Opponent" = 'panathinaikos'
What the highest Year with a Remixed by Laurent Boutonnat?
CREATE TABLE table_name_38 (year INTEGER,remixed_by VARCHAR)
SELECT MAX(year) FROM table_name_38 WHERE remixed_by = "laurent boutonnat"
when did patient 8016 had a mch test the first time during a month before?
CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_icd_diagnoses (row_id...
SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mch') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8016) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIM...
What is High Points, when Game is '3'?
CREATE TABLE table_name_81 (high_points VARCHAR,game VARCHAR)
SELECT high_points FROM table_name_81 WHERE game = 3
What alumni had noor jehangir as their fresh meat partner?
CREATE TABLE table_26419467_1 (alumni VARCHAR,fresh_meat_partner VARCHAR)
SELECT alumni FROM table_26419467_1 WHERE fresh_meat_partner = "Noor Jehangir"
who coached the muncie flyers to an indiana state championship ?
CREATE TABLE table_200_32 (id number,"year" number,"w" number,"l" number,"t" number,"finish" text,"coach" text)
SELECT "coach" FROM table_200_32 WHERE "finish" = 'indiana state champs'
What is the highest amount of points with less than 5 assists and less than 2 goals?
CREATE TABLE table_47566 ("Event" text,"Games played" real,"Goals" real,"Assists" real,"Points" real)
SELECT MAX("Points") FROM table_47566 WHERE "Assists" < '5' AND "Goals" < '2'
What are the first names and support rep ids for employees serving 10 or more customers, and order X-axis in descending order.
CREATE TABLE Playlist (PlaylistId integer,Name varchar(120))CREATE TABLE Album (AlbumId integer,Title varchar(160),ArtistId integer)CREATE TABLE Genre (GenreId integer,Name varchar(120))CREATE TABLE Employee (EmployeeId integer,LastName varchar(20),FirstName varchar(20),Title varchar(30),ReportsTo integer,BirthDate dat...
SELECT T1.FirstName, T1.SupportRepId FROM Customer AS T1 JOIN Employee AS T2 ON T1.SupportRepId = T2.EmployeeId ORDER BY T1.FirstName DESC
What was the score when the Rangers' attendance was 23,493?
CREATE TABLE table_69180 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text)
SELECT "Score" FROM table_69180 WHERE "Attendance" = '23,493'
How many addresses have zip code 197?
CREATE TABLE students_in_detention (student_id number,detention_id number,incident_id number)CREATE TABLE detention (detention_id number,detention_type_code text,teacher_id number,datetime_detention_start time,datetime_detention_end time,detention_summary text,other_details text)CREATE TABLE ref_detention_type (detenti...
SELECT COUNT(*) FROM addresses WHERE zip_postcode = "197"
What is the first episode number?
CREATE TABLE table_15187735_20 (episode INTEGER)
SELECT MIN(episode) FROM table_15187735_20
Which Precincts has a County of passaic?
CREATE TABLE table_59248 ("County" text,"Precincts" text,"E. Greenberg" text,"G. Hager" text,"T. Wyka" text)
SELECT "Precincts" FROM table_59248 WHERE "County" = 'passaic'
count the number of times until 2100 patient 16572 received a closed liver biopsy.
CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE d_items (row_id number,itemid number,label text,link...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'closed liver biopsy') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16572) AND STRFTIME('%y', proce...
what time was patient 035-13344 prescribed a drug for the last time until 27 months ago?
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE lab (labid number,patientunitstayid number,labname 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 = '035-13344')) AND DATETIME(medication.drugstarttime) <= DATETIM...
what drug was the first drug prescribed for patient 99661 until 07/2101?
CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99661) AND STRFTIME('%y-%m', prescriptions.startdate) <= '2101-07' ORDER BY prescriptions.startdate LIMIT 1
What nation had 135 Bronze medals?
CREATE TABLE table_14706 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT COUNT("Bronze") FROM table_14706 WHERE "Total" = '135'
What is the lowest number of gold medals the nation with less than 0 silver medals has?
CREATE TABLE table_76376 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MIN("Gold") FROM table_76376 WHERE "Silver" < '0'
what is the name when the type is hydro, the capacity (mw) is less than 478, the rank is more than 85 and the province is quebec?
CREATE TABLE table_62936 ("Rank" real,"Name" text,"Capacity (MW)" real,"Province" text,"Type" text)
SELECT "Name" FROM table_62936 WHERE "Type" = 'hydro' AND "Capacity ( MW )" < '478' AND "Rank" > '85' AND "Province" = 'quebec'
Get the avg size of a question for a tag.
CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId num...
SELECT AVG(LENGTH(p.Body)) FROM Posts AS p INNER JOIN PostTags AS pt ON pt.TagId = @TagId WHERE pt.PostId = p.Id AND p.PostTypeId = 1
count the number of patients whose diagnoses icd9 code is v489 and drug type is additive?
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "V489" AND prescriptions.drug_type = "ADDITIVE"
show me flights from DENVER to ATLANTA
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 airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,co...
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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA...
What is the manhattan for richmond 35%?
CREATE TABLE table_16448 ("1973 Democratic initial primary" text,"Manhattan" text,"The Bronx" text,"Brooklyn" text,"Queens" text,"Richmond [Staten Is.]" text,"Total" real,"%" text)
SELECT "Manhattan" FROM table_16448 WHERE "Richmond [Staten Is.]" = '35%'
What was the total number of Points when the value Difference was 13, and when the value Lost was greater than 3?
CREATE TABLE table_76151 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text)
SELECT SUM("Points") FROM table_76151 WHERE "Difference" = '13' AND "Lost" > '3'
Zero scored question with no actual answer. Questions having zero score or less, zero answers
CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,Revis...
SELECT Id AS "post_link", Score AS "Votes", CreationDate AS "Posted", LastActivityDate AS "Last Active", ViewCount AS "Views", CommentCount AS "Comments" FROM Posts WHERE PostTypeId = 1 AND AcceptedAnswerId IS NULL AND ClosedDate IS NULL AND AnswerCount = 0 AND CreationDate < DATEADD(Year, -'##Year##', GETDATE()) AND S...
show flights from PHILADELPHIA to SAN FRANCISCO
CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE equipment_sequence (aircraft_code_s...
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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'S...
how many hours has patient 021-95970 been since the first procedure during this hospital encounter?
CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-95970...
What is Milena Reljin's place with a smaller than 9.8 rope?
CREATE TABLE table_61086 ("Place" real,"Name" text,"All Around" real,"Rope" real,"Total" real)
SELECT "Place" FROM table_61086 WHERE "Rope" < '9.8' AND "Name" = 'milena reljin'
List all customer status codes and the number of customers having each status code.
CREATE TABLE Customers (customer_status_code VARCHAR)
SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code
What is the 2005 figure when 2002 is A and 2010 is 3R?
CREATE TABLE table_name_29 (Id VARCHAR)
SELECT 2005 FROM table_name_29 WHERE 2002 = "a" AND 2010 = "3r"
what is the number of patients whose language is engl and age is less than 30?
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 WHERE demographic.language = "ENGL" AND demographic.age < "30"
what is the only week with more than 80,000 attendance
CREATE TABLE table_204_207 (id number,"week" number,"date" text,"opponent" text,"result" text,"attendance" number,"bye" text)
SELECT "week" FROM table_204_207 WHERE "attendance" > 80000