instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Where did the home team play when they scored 16.17 (113)?
CREATE TABLE table_10905 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Venue" FROM table_10905 WHERE "Home team score" = '16.17 (113)'
What episode was written by jonathan lewis?
CREATE TABLE table_36050 ("Episode" text,"Title" text,"Writer(s)" text,"Preservation" text,"Original airdate" text)
SELECT "Episode" FROM table_36050 WHERE "Writer(s)" = 'jonathan lewis'
Name the League which has a Regular Season of 3rd, atlantic?
CREATE TABLE table_name_86 (league VARCHAR,regular_season VARCHAR)
SELECT league FROM table_name_86 WHERE regular_season = "3rd, atlantic"
What date was the game played at Lake Oval?
CREATE TABLE table_51467 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Date" FROM table_51467 WHERE "Venue" = 'lake oval'
what is the outcome when the tournament is san diego and the opponent is ann grossman?
CREATE TABLE table_name_40 (outcome VARCHAR,tournament VARCHAR,opponent VARCHAR)
SELECT outcome FROM table_name_40 WHERE tournament = "san diego" AND opponent = "ann grossman"
what is minimum days of hospital stay of patients whose ethnicity is black/haitian?
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 MIN(demographic.days_stay) FROM demographic WHERE demographic.ethnicity = "BLACK/HAITIAN"
calculate the two year survival probability of patients to whom acetazolamide sodium was prescribed after they were diagnosed with ant disloc humerus-close.
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE transfers (row_id number,subjec...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
Which cities have at least one customer but no performer?
CREATE TABLE performers_in_bookings (order_id number,performer_id number)CREATE TABLE services (service_id number,service_type_code text,workshop_group_id number,product_description text,product_name text,product_price number,other_product_service_details text)CREATE TABLE stores (store_id text,address_id number,market...
SELECT T1.city_town FROM addresses AS T1 JOIN customers AS T2 ON T1.address_id = T2.address_id EXCEPT SELECT T1.city_town FROM addresses AS T1 JOIN performers AS T2 ON T1.address_id = T2.address_id
What is the program where the focus is general management?
CREATE TABLE table_12591022_2 (program VARCHAR,focus VARCHAR)
SELECT program FROM table_12591022_2 WHERE focus = "General Management"
What's the highest pick for SS position?
CREATE TABLE table_name_76 (pick INTEGER,position VARCHAR)
SELECT MAX(pick) FROM table_name_76 WHERE position = "ss"
R to Python ratio over time.
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,T...
SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, SUM(CASE WHEN Tags.TagName = 'r' THEN 1.0 ELSE 0 END) AS R, SUM(CASE WHEN Tags.TagName = 'python' THEN 1 ELSE 0 END) AS Python FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = Po...
How many vessels are named aqua jewel?
CREATE TABLE table_56930 ("Ship name" text,"Year" real,"Length" text,"Width" text,"Passengers" real,"Vessels" real,"Speed" real)
SELECT COUNT("Vessels") FROM table_56930 WHERE "Ship name" = 'aqua jewel'
what is the cheapest flight from BOSTON to BWI
CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE month (month_number int,month_name text)CREATE TABLE code_description (code varchar,description text)CREATE TABLE airport (airport_code varchar,airport_name text,airport_location tex...
SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, fare, flight, flight_fare WHERE (airport.airport_code = 'BWI' AND city.city_code = airport_service.city_code AND city.city_name = 'BOSTON' AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code) AND fare.o...
give me the number of patients whose ethnicity is hispanic/latino - puerto rican and days of hospital stay is greater than 16?
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.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.days_stay > "16"
Most popular questions per tag in a year.
CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE Tags (Id number,TagName text,Count number,Excerpt...
SELECT p.Id, p.Body, p.CreationDate, p.Score, p.ParentId, p.Title, p.Tags, p.ViewCount, p.AnswerCount, p.FavoriteCount, p.CommentCount, p.AcceptedAnswerId FROM Posts AS p LEFT JOIN PostTags AS pt ON p.Id = pt.PostId LEFT JOIN Tags AS t ON pt.TagId = t.Id WHERE t.TagName = '##TagName:string##' AND YEAR(p.CreationDate) =...
how many reviews were in print ?
CREATE TABLE table_204_692 (id number,"publication" text,"score" text,"review" text)
SELECT COUNT("review") FROM table_204_692 WHERE "review" = 'print'
What was tyre that was made by cooper - bristol that was driven by bob gerard?
CREATE TABLE table_name_77 (tyre VARCHAR,constructor VARCHAR,driver VARCHAR)
SELECT tyre FROM table_name_77 WHERE constructor = "cooper - bristol" AND driver = "bob gerard"
how many patients' year of birth is before 2121 with joint fluid as the lab test fluid?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2121" AND lab.fluid = "Joint Fluid"
give me the number of patients whose ethnicity is white and admission year is less than 2154?
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 text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.admityear < "2154"
What is the smallest number of people to attend a game with an H/A of h and the opponent was Roma?
CREATE TABLE table_name_67 (attendance INTEGER,h___a VARCHAR,opponents VARCHAR)
SELECT MIN(attendance) FROM table_name_67 WHERE h___a = "h" AND opponents = "roma"
What opponent has a week less than 12, with November 25, 1965 as the date?
CREATE TABLE table_name_29 (opponent VARCHAR,week VARCHAR,date VARCHAR)
SELECT opponent FROM table_name_29 WHERE week < 12 AND date = "november 25, 1965"
what is the most episodes when the average ratings is 18.8%?
CREATE TABLE table_name_52 (episodes INTEGER,average_ratings VARCHAR)
SELECT MAX(episodes) FROM table_name_52 WHERE average_ratings = "18.8%"
What rank was Core Districts + Inner Suburbs and had a population of 10123000?
CREATE TABLE table_name_37 (rank INTEGER,definition VARCHAR,population VARCHAR)
SELECT MAX(rank) FROM table_name_37 WHERE definition = "core districts + inner suburbs" AND population = "10123000"
How many venues were there for the match on November 6?
CREATE TABLE table_23081 ("Scorecard" real,"Date" text,"Venue" text,"Team 1" text,"Team 2" text,"Result" text,"Man of the Match" text)
SELECT COUNT("Venue") FROM table_23081 WHERE "Date" = 'November 6'
Which team had a start of 8 in years under 2008?
CREATE TABLE table_name_22 (team VARCHAR,start VARCHAR,year VARCHAR)
SELECT team FROM table_name_22 WHERE start = 8 AND year < 2008
Which nationality is player Brian Wilks?
CREATE TABLE table_21721351_18 (nationality VARCHAR,player VARCHAR)
SELECT nationality FROM table_21721351_18 WHERE player = "Brian Wilks"
Which Bronze has a Gold smaller than 1, and a Rank of 17, and a Nation of china?
CREATE TABLE table_40752 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MAX("Bronze") FROM table_40752 WHERE "Gold" < '1' AND "Rank" = '17' AND "Nation" = 'china'
What district did George Miller belong to?
CREATE TABLE table_19753079_8 (district VARCHAR,incumbent VARCHAR)
SELECT district FROM table_19753079_8 WHERE incumbent = "George Miller"
When did Montreal visit and have a score of 1-4?
CREATE TABLE table_name_47 (date VARCHAR,visitor VARCHAR,score VARCHAR)
SELECT date FROM table_name_47 WHERE visitor = "montreal" AND score = "1-4"
What date was the record 38-22?
CREATE TABLE table_71515 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Record" text)
SELECT "Date" FROM table_71515 WHERE "Record" = '38-22'
What is the alternate of the nation with Piotras Gerasimovici as the second?
CREATE TABLE table_name_19 (alternate VARCHAR,second VARCHAR)
SELECT alternate FROM table_name_19 WHERE second = "piotras gerasimovici"
Return a histogram on what are the different transaction types, and how many transactions of each have taken place?, and rank total number from high to low order please.
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 transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY COUNT(*) DESC
what was the two year survival rate of retropharyngeal abscess patients who were prescribed with dobutamine?
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_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
What is the airport with the IATA MEL?
CREATE TABLE table_1694 ("Rank" real,"Airport" text,"Location" text,"IATA" text,"1985\u201386" real,"1990\u201391" real,"1995\u201396" real,"2000\u201301" real,"2005\u201306" real,"2007\u201308" real,"2009\u201310" real,"2010-11" real)
SELECT COUNT("Airport") FROM table_1694 WHERE "IATA" = 'MEL'
WHAT POSITION HAS A PICK SMALLER THAN 33, AND PLAYER BEING DARRELL ARTHUR?
CREATE TABLE table_name_67 (position VARCHAR,pick VARCHAR,player VARCHAR)
SELECT position FROM table_name_67 WHERE pick < 33 AND player = "darrell arthur"
What was the home team that scored 12.21 (93)?
CREATE TABLE table_33489 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team" FROM table_33489 WHERE "Home team score" = '12.21 (93)'
Who is listed as the Winners with a Year of 2005?
CREATE TABLE table_15303 ("Year" text,"Venue" text,"Winners" text,"2nd place" text,"3rd place" text)
SELECT "Winners" FROM table_15303 WHERE "Year" = '2005'
please show me any UA flights including connections between BOSTON and SAN FRANCISCO at 1700 in the evening
CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE month (month_number int,month_name text)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE compartment_class (compartment varchar,class_type ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time = 1700 AND flight.to_airport = AIRPORT_SERVICE_...
Write a query that will show just the User ID and Text of a comment by a single user. You may choose.
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 PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,Cl...
SELECT UserId, Text FROM Comments WHERE Text LIKE '@Yvette%'
What is the average hexadecimal with a decimal greater than 57?
CREATE TABLE table_name_2 (hexadecimal INTEGER,decimal INTEGER)
SELECT AVG(hexadecimal) FROM table_name_2 WHERE decimal > 57
how many patients whose diagnoses short title is acute kidney failure nos and drug route is tp?
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la...
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 = "Acute kidney failure NOS" AND prescriptions.route = "TP"
What are the customer phone numbers under the policy 'Life Insurance'?
CREATE TABLE customers (customer_id number,customer_name text)CREATE TABLE first_notification_of_loss (fnol_id number,customer_id number,policy_id number,service_id number)CREATE TABLE available_policies (policy_id number,policy_type_code text,customer_phone text)CREATE TABLE customers_policies (customer_id number,poli...
SELECT customer_phone FROM available_policies WHERE policy_type_code = "Life Insurance"
What is the Week number on December 18, 1960?
CREATE TABLE table_name_17 (week VARCHAR,date VARCHAR)
SELECT COUNT(week) FROM table_name_17 WHERE date = "december 18, 1960"
when did patient 015-52724 first have a procedure in the current hospital visit?
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 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 = '015-52724' AND patient.hospitaldischargetime IS NULL)) ORDER BY t...
Give me the comparison about the amount of date_address_to over the date_address_to bin date_address_to by time.
CREATE TABLE Ref_Address_Types (address_type_code VARCHAR(15),address_type_description VARCHAR(80))CREATE TABLE Students_in_Detention (student_id INTEGER,detention_id INTEGER,incident_id INTEGER)CREATE TABLE Addresses (address_id INTEGER,line_1 VARCHAR(120),line_2 VARCHAR(120),line_3 VARCHAR(120),city VARCHAR(80),zip_p...
SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses ORDER BY monthly_rental DESC
What is the lowest GEO ID for the longitude of -102.158045 and the water in square miles larger than 0.979?
CREATE TABLE table_62964 ("Township" text,"County" text,"Pop. (2010)" real,"Land (sqmi)" real,"Water (sqmi)" real,"Latitude" real,"Longitude" real,"GEO ID" real,"ANSI code" real)
SELECT MIN("GEO ID") FROM table_62964 WHERE "Longitude" = '-102.158045' AND "Water (sqmi)" > '0.979'
What is the Date of the Competition with a Score of 4-0 and 5-0 Result?
CREATE TABLE table_42713 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text)
SELECT "Date" FROM table_42713 WHERE "Result" = '5-0' AND "Score" = '4-0'
list all flights on CO leaving DENVER on monday
CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE airport_service (city_code varchar,airport_code varchar,mile...
SELECT DISTINCT flight.flight_id FROM airport_service, city, date_day, days, flight WHERE (city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days...
What is listed under tor floysvik when couple is maria & asmund?
CREATE TABLE table_30660 ("Couple" text,"Style" text,"Music" text,"Trine Dehli Cleve" real,"Tor Fl\u00f8ysvik" real,"Karianne Gulliksen" real,"Christer Tornell" real,"Total" real)
SELECT MIN("Tor Fl\u00f8ysvik") FROM table_30660 WHERE "Couple" = 'Maria & Asmund'
what's the cylinders/ valves with model being 1.8 20v
CREATE TABLE table_1176162_3 (cylinders__valves VARCHAR,model VARCHAR)
SELECT cylinders__valves FROM table_1176162_3 WHERE model = "1.8 20V"
What was the largest capacity when the club was F.C. Igea Virtus Barcellona?
CREATE TABLE table_58729 ("Club" text,"City" text,"Stadium" text,"Capacity" real,"2007\u201308 season" text)
SELECT MAX("Capacity") FROM table_58729 WHERE "Club" = 'f.c. igea virtus barcellona'
What is the bronze for Kyrgyzstan nation with a silver record of greater than 0?
CREATE TABLE table_name_8 (bronze INTEGER,nation VARCHAR,silver VARCHAR)
SELECT AVG(bronze) FROM table_name_8 WHERE nation = "kyrgyzstan" AND silver > 0
Show the name for regions not affected.
CREATE TABLE affected_region (region_name VARCHAR,region_id VARCHAR)CREATE TABLE region (region_name VARCHAR,region_id VARCHAR)
SELECT region_name FROM region WHERE NOT region_id IN (SELECT region_id FROM affected_region)
Name the Result F A that has a League position of 1st on 4 january 1994?
CREATE TABLE table_name_87 (result_f___a VARCHAR,league_position VARCHAR,date VARCHAR)
SELECT result_f___a FROM table_name_87 WHERE league_position = "1st" AND date = "4 january 1994"
How many clubs does 'Linda Smith' have membership for?
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 COUNT(*) 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 t3.fname = "Linda" AND t3.lname = "Smith"
what is the winter olympics when the country is soviet union and holmenkollen is 1970, 1979?
CREATE TABLE table_48212 ("Winner" text,"Country" text,"Winter Olympics" real,"FIS Nordic World Ski Championships" text,"Holmenkollen" text)
SELECT SUM("Winter Olympics") FROM table_48212 WHERE "Country" = 'soviet union' AND "Holmenkollen" = '1970, 1979'
Whom is the away team when the Away team score is 23.14 (152)?
CREATE TABLE table_33217 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Away team" FROM table_33217 WHERE "Away team score" = '23.14 (152)'
Show the authors who have submissions to more than one workshop.
CREATE TABLE workshop (workshop_id number,date text,venue text,name text)CREATE TABLE submission (submission_id number,scores number,author text,college text)CREATE TABLE acceptance (submission_id number,workshop_id number,result text)
SELECT T2.author FROM acceptance AS T1 JOIN submission AS T2 ON T1.submission_id = T2.submission_id GROUP BY T2.author HAVING COUNT(DISTINCT T1.workshop_id) > 1
What is the time/retired for thierry boutsen?
CREATE TABLE table_78003 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT "Time/Retired" FROM table_78003 WHERE "Driver" = 'thierry boutsen'
tell me whether the evd output (ml)-icp/external ventricular drain (evd) right ventriculostomy event happend to patient 006-133605 on the current icu visit?
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 vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,he...
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-133605') AND patient.unitdischargetime IS NULL) AND intakeoutput.c...
What was the run 3 for the team with a run 1 of 1:17.6?
CREATE TABLE table_47139 ("Rank" text,"Team" text,"Run 1" text,"Run 2" text,"Run 3" text,"Run 4" text,"Final" text)
SELECT "Run 3" FROM table_47139 WHERE "Run 1" = '1:17.6'
Name the high rebounds for march 17
CREATE TABLE table_15780049_8 (high_rebounds VARCHAR,date VARCHAR)
SELECT high_rebounds FROM table_15780049_8 WHERE date = "March 17"
What is the highest Presidency that Took Office after 1974 and Left Office in 1998?
CREATE TABLE table_55848 ("Presidency" real,"President" text,"Date of Birth" text,"Took office" real,"Left office" text)
SELECT MAX("Presidency") FROM table_55848 WHERE "Left office" = '1998' AND "Took office" > '1974'
What was the length for GT class at Portland International Raceway?
CREATE TABLE table_5841 ("Race" text,"Length" text,"Class" text,"Circuit" text,"Date" text)
SELECT "Length" FROM table_5841 WHERE "Class" = 'gt' AND "Circuit" = 'portland international raceway'
Next Winter , who will teach the Core classes ?
CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday...
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
What is the name of the deputy in 1992 93?
CREATE TABLE table_name_41 (deputy VARCHAR,year VARCHAR)
SELECT deputy FROM table_name_41 WHERE year = "1992–93"
For End of Fiscal Years past 1980 that also have as % of GDP Low-High of 83.4-84.4, and a Debt Held By Public ($Billions) smaller than 7,552 what would be the average Gross Debt in $Billions undeflated Treas. in said years?
CREATE TABLE table_54105 ("End of Fiscal Year" real,"Gross Debt in $Billions undeflated Treas." real,"as % of GDP Low-High" text,"Debt Held By Public ($Billions)" real,"as % of GDP (Treas/MW,OMB or OMB/MW)" real,"GDP $Billions OMB/BEA est.=MW.com" text)
SELECT AVG("Gross Debt in $Billions undeflated Treas.") FROM table_54105 WHERE "End of Fiscal Year" > '1980' AND "as % of GDP Low-High" = '83.4-84.4' AND "Debt Held By Public ($Billions)" < '7,552'
A bar chart showing the number of last name for all female students. Their sex is F.
CREATE TABLE Has_Allergy (StuID INTEGER,Allergy VARCHAR(20))CREATE TABLE Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20))CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))
SELECT LName, COUNT(LName) FROM Student WHERE Sex = 'F' GROUP BY LName
what's the maximum total cost of a hospital that includes a laboratory ntprobnp test?
CREATE TABLE d_labitems (row_id number,itemid number,label text)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,ro...
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ntprobnp')) GROUP BY cost.hadm_id) AS t1
patients with active or clinically significant conditions affecting absorption, distribution or metabolism of the study medication ( e.g., inflammatory bowel disease, gastric or duodenal ulcers or severe lactose intolerance ) .
CREATE TABLE table_train_131 ("id" int,"thyroid_disease" bool,"pulmonary_disease" bool,"right_bundle_branch_block" bool,"allergy_to_piperidine_derivatives" bool,"obstructive_pulmonary_disease" bool,"inflammatory_bowel_disease" bool,"renal_disease" bool,"hepatic_disease" bool,"cardiovascular_disease" bool,"duodenal_ulce...
SELECT * FROM table_train_131 WHERE absorption = 1 OR distribution = 1 OR metabolism = 1 OR (inflammatory_bowel_disease = 1 OR gastric = 1 OR duodenal_ulcers = 1 OR lactose_intolerance = 1)
Show me the number of patients who were ordered to get urine lab test and died in 2111 or before that.
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2111.0" AND lab.fluid = "Urine"
In the Canadian Grand Prix, what tyre was used when Jacky Ickx held pole position?
CREATE TABLE table_57537 ("Race" text,"Circuit" text,"Date" text,"Pole position" text,"Fastest lap" text,"Winning driver" text,"Constructor" text,"Tyre" text,"Report" text)
SELECT "Tyre" FROM table_57537 WHERE "Pole position" = 'jacky ickx' AND "Race" = 'canadian grand prix'
A bar chart shows the distribution of ACC_Regular_Season and Team_ID , could you rank Y in descending order?
CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)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_Perce...
SELECT ACC_Regular_Season, Team_ID FROM basketball_match ORDER BY Team_ID DESC
Which Season has a Game of fcs midwest region, and a Score of 40-33?
CREATE TABLE table_name_29 (season INTEGER,game VARCHAR,score VARCHAR)
SELECT MAX(season) FROM table_name_29 WHERE game = "fcs midwest region" AND score = "40-33"
What is the lowest percentage of wins for 6 games and more than 77 total wins?
CREATE TABLE table_name_63 (win_percentage INTEGER,games_behind VARCHAR,wins VARCHAR)
SELECT MIN(win_percentage) FROM table_name_63 WHERE games_behind = "6½" AND wins > 77
Show me about the correlation between Credits and Instructor in a scatter chart.
CREATE TABLE Member_of (FacID INTEGER,DNO INTEGER,Appt_Type VARCHAR(15))CREATE TABLE Faculty (FacID INTEGER,Lname VARCHAR(15),Fname VARCHAR(15),Rank VARCHAR(15),Sex VARCHAR(1),Phone INTEGER,Room VARCHAR(5),Building VARCHAR(13))CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCH...
SELECT Credits, Instructor FROM Course ORDER BY Credits
What type of environment is the venue that was built in 2003?
CREATE TABLE table_40340 ("Venue" text,"Location" text,"Capacity" text,"Owner" text,"Environment" text,"Year Built" text)
SELECT "Environment" FROM table_40340 WHERE "Year Built" = '2003'
Which Cuts made has a Tournament of totals, and Wins smaller than 11?
CREATE TABLE table_name_25 (cuts_made INTEGER,tournament VARCHAR,wins VARCHAR)
SELECT AVG(cuts_made) FROM table_name_25 WHERE tournament = "totals" AND wins < 11
Can you tell me the lowest Year that has the Rank smaller the 132, and the Name of biodiversity richness?
CREATE TABLE table_name_99 (year INTEGER,rank VARCHAR,name VARCHAR)
SELECT MIN(year) FROM table_name_99 WHERE rank < 132 AND name = "biodiversity richness"
number of citations of linda shapiro
CREATE TABLE field (fieldid int)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE keyphrase (ke...
SELECT DISTINCT COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'linda shapiro' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
the two level 6 seasons were 2012/13 and what other season ?
CREATE TABLE table_204_717 (id number,"season" text,"level" number,"division" text,"place" text)
SELECT "season" FROM table_204_717 WHERE "season" <> '2012/13' AND "level" = 6
Will there be a 1 -credit upper level class for Fall 2016 ?
CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement varchar,enforced_requirement varchar,description varchar,num_semesters int,num_enrolled int,has_discussion varchar,has_lab varchar,has_projects varchar,has_exams varchar,num_reviews int,clarity_score i...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.credits = 1 AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Fall' AND seme...
Which gene has the subject number 21?
CREATE TABLE table_name_28 (gene VARCHAR,subject_number VARCHAR)
SELECT gene FROM table_name_28 WHERE subject_number = "21"
exactly what is the total amount of tpn w/lipids intake that patient 26350 has received?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_...
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 = 26350)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
when on their current hospital visit did patient 5828 get the first microbiology test?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id nu...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828 AND admissions.dischtime IS NULL) ORDER BY microbiologyevents.charttime LIMIT 1
What is the average Weight of the person who is 6'9'?
CREATE TABLE table_40179 ("Name" text,"Pos." text,"Height" text,"Weight" real,"Year" text,"Hometown (Previous school)" text)
SELECT AVG("Weight") FROM table_40179 WHERE "Height" = '6''9'
How many total innings have an average under 6.33, strike rate under 71.43, balls faced over 36, and smaller than 19 runs scored?
CREATE TABLE table_42204 ("Name" text,"Innings" real,"Runs Scored" real,"Balls Faced" real,"Average" real,"S.R." real)
SELECT SUM("Innings") FROM table_42204 WHERE "Average" < '6.33' AND "S.R." < '71.43' AND "Balls Faced" > '36' AND "Runs Scored" < '19'
how many seats were won by the social democratic party in 1994 ?
CREATE TABLE table_204_72 (id number,"election year" number,"# of\nconstituency votes" number,"# of\nparty list votes" number,"% of\nparty list votes" number,"# of\noverall seats won" text,"+/-" number)
SELECT "# of\noverall seats won" FROM table_204_72 WHERE "election year" = 1994
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the email , list by the names in asc.
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 EMAIL, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL
What is the duration of the oldest actor?
CREATE TABLE actor (Duration VARCHAR,Age VARCHAR)
SELECT Duration FROM actor ORDER BY Age DESC LIMIT 1
What is the distance for the unnamed race with 3 runners at Newcastle?
CREATE TABLE table_69725 ("Race name" text,"Dist (miles)" text,"Course" text,"Prize" text,"Jockey" text,"Odds" text,"Runners" text)
SELECT "Dist (miles)" FROM table_69725 WHERE "Race name" = 'unnamed race' AND "Runners" = '3' AND "Course" = 'newcastle'
Which country has an IATA of JFK?
CREATE TABLE table_68834 ("City" text,"Country" text,"IATA" text,"ICAO" text,"Airport" text)
SELECT "Country" FROM table_68834 WHERE "IATA" = 'jfk'
How many weeks have an attendance greater than 55,121, and l 27-7 as the result?
CREATE TABLE table_66424 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT SUM("Week") FROM table_66424 WHERE "Attendance" > '55,121' AND "Result" = 'l 27-7'
how many candidates with result being retired to run for u. s. senate republican hold
CREATE TABLE table_1341586_19 (candidates VARCHAR,result VARCHAR)
SELECT COUNT(candidates) FROM table_1341586_19 WHERE result = "Retired to run for U. S. Senate Republican hold"
who wins the most ?
CREATE TABLE table_204_334 (id number,"opposition" text,"matches" number,"won" number,"drawn" number,"lost" number,"for" number,"against" number,"win%" text)
SELECT "opposition" FROM table_204_334 WHERE "won" = (SELECT MAX("won") FROM table_204_334)
how many days have passed since patient 017-88691 received a laboratory test of troponin - i for the first time on their current hospital visit?
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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-88691' AND patient.hospi...
count the number of patients who were diagnosed with diabetes mellitus but did not return to the hospital within 2 months in 2104.
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid num...
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'diabetes mellitus' AND STRFTIME('%y', diagnosis.diagnosistime) = '2104') AS t1) - (SELECT COUNT(DIST...
Which Location Attendance has a High assists of raymond felton (5), and a Record of 35 44?
CREATE TABLE table_name_17 (location_attendance VARCHAR,high_assists VARCHAR,record VARCHAR)
SELECT location_attendance FROM table_name_17 WHERE high_assists = "raymond felton (5)" AND record = "35–44"
provide me the top four most common diagnosis since 2101?
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname tex...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) >= '2101' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4
Women's singles of akvil stapu aityt , and a Year of 2010 had what mixed doubles?
CREATE TABLE table_38047 ("Year" real,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text)
SELECT "Mixed doubles" FROM table_38047 WHERE "Women's singles" = 'akvilė stapušaitytė' AND "Year" = '2010'