instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
When did the episode written by Abe Sylvia originally air?
CREATE TABLE table_3681 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (million)" text)
SELECT "Original air date" FROM table_3681 WHERE "Written by" = 'Abe Sylvia'
Return a histogram on what is the average high temperature for each day of week?, show x axis in asc order please.
CREATE TABLE train (id int,train_number int,name text,origin text,destination text,time text,interval text)CREATE TABLE station (id int,network_name text,services text,local_authority text)CREATE TABLE weekly_weather (station_id int,day_of_week text,high_temperature int,low_temperature int,precipitation real,wind_speed...
SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY day_of_week
What Label has a Catalog number of 885 572-7 in 7' single Format?
CREATE TABLE table_34058 ("Date" text,"Label" text,"Region" text,"Format" text,"Catalog" text)
SELECT "Label" FROM table_34058 WHERE "Format" = '7" single' AND "Catalog" = '885 572-7'
When rudolph kleberg (d) is the successor what is the date of successors taking office?
CREATE TABLE table_26657 ("District" text,"Vacator" text,"Reason for Vacancy" text,"Successor" text,"Date of successors taking office" text)
SELECT "Date of successors taking office" FROM table_26657 WHERE "Successor" = 'Rudolph Kleberg (D)'
what is the diagnoses short title and diagnoses long title of diagnoses icd9 code 4239?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "4239"
How many touchdowns did Redden score?
CREATE TABLE table_14342210_12 (touchdowns INTEGER,player VARCHAR)
SELECT MIN(touchdowns) FROM table_14342210_12 WHERE player = "Redden"
What are the number of the dates with a maximum temperature higher than 85?
CREATE TABLE status (station_id INTEGER,bikes_available INTEGER,docks_available INTEGER,time TEXT)CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_i...
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85
How many bronze medals did the nation have that had less than 3 silver, 5 gold and ranked better than 31?
CREATE TABLE table_14010 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT SUM("Bronze") FROM table_14010 WHERE "Silver" < '3' AND "Rank" < '31' AND "Gold" = '5'
What method was there in round 1 when the location was Aruba?
CREATE TABLE table_62561 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" text,"Location" text)
SELECT "Method" FROM table_62561 WHERE "Round" = '1' AND "Location" = 'aruba'
tell me what are the top four most common output events?
CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid nu...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 4)
What position was played by the player who was 2.12 meters tall?
CREATE TABLE table_583 ("No" real,"Player" text,"Height" text,"Position" text,"Year born" real,"Current Club" text)
SELECT "Position" FROM table_583 WHERE "Height" = '2.12'
what is the daily average value of patient 3267's weight until 07/2104?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance tex...
SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3267)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit...
Scatter chart. how many staff does each project has? List the project id and the number in an ascending order.
CREATE TABLE Research_Staff (staff_id INTEGER,employer_organisation_id INTEGER,staff_details VARCHAR(255))CREATE TABLE Staff_Roles (role_code VARCHAR(10),role_description VARCHAR(255))CREATE TABLE Projects (project_id INTEGER,organisation_id INTEGER,project_details VARCHAR(255))CREATE TABLE Project_Outcomes (project_id...
SELECT T1.project_id, COUNT(*) FROM Project_Staff AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*)
A bar chart for what are the number of the facility codes of the apartments with more than four bedrooms?
CREATE TABLE Apartment_Buildings (building_id INTEGER,building_short_name CHAR(15),building_full_name VARCHAR(80),building_description VARCHAR(255),building_address VARCHAR(255),building_manager VARCHAR(50),building_phone VARCHAR(80))CREATE TABLE View_Unit_Status (apt_id INTEGER,apt_booking_id INTEGER,status_date DATET...
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code
Which assist/pass is in Ferreiras?
CREATE TABLE table_65212 ("Date" text,"Location" text,"Lineup" text,"Assist/pass" text,"Score" text,"Result" text,"Competition" text)
SELECT "Assist/pass" FROM table_65212 WHERE "Location" = 'ferreiras'
A line chart for what are the number of the payment dates for any payments that have an amount greater than 10 or were handled by a staff member with the first name Elsa?, and show by the payment_date in descending.
CREATE TABLE address (address_id SMALLINT UNSIGNED,address VARCHAR(50),address2 VARCHAR(50),district VARCHAR(20),city_id SMALLINT UNSIGNED,postal_code VARCHAR(10),phone VARCHAR(20),last_update TIMESTAMP)CREATE TABLE language (language_id TINYINT UNSIGNED,name CHAR(20),last_update TIMESTAMP)CREATE TABLE film_text (film_...
SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' GROUP BY payment_date ORDER BY payment_date DESC
What school did Paul Dawkins play for?
CREATE TABLE table_name_34 (school_club_team VARCHAR,player VARCHAR)
SELECT school_club_team FROM table_name_34 WHERE player = "paul dawkins"
What's the average Rd number for dane jackson with a pick number over 44?
CREATE TABLE table_name_2 (rd__number INTEGER,player VARCHAR,pick__number VARCHAR)
SELECT AVG(rd__number) FROM table_name_2 WHERE player = "dane jackson" AND pick__number > 44
What date has a competition of 2012 afc challenge cup, and dasarath rangasala stadium, kathmandu as the venue?
CREATE TABLE table_name_56 (date VARCHAR,competition VARCHAR,venue VARCHAR)
SELECT date FROM table_name_56 WHERE competition = "2012 afc challenge cup" AND venue = "dasarath rangasala stadium, kathmandu"
Are there any courses taught by Prof. Nicholas Gaudio ?
CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students int,heavy_assignments int,respected int,participation int,heavy_reading int,tough_grade...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Nicholas Gaudio%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id...
If the name is Timo Higgins, what is the total date of birth amount?
CREATE TABLE table_24925 ("Name" text,"Position" text,"Height" text,"Weight" text,"Date of Birth" text,"Home Team" text)
SELECT COUNT("Date of Birth") FROM table_24925 WHERE "Name" = 'Timo Higgins'
What was the record the day David Weathers (15) had a save?
CREATE TABLE table_name_10 (record VARCHAR,save VARCHAR)
SELECT record FROM table_name_10 WHERE save = "david weathers (15)"
What was the orginal air date for episodes with production code 2acx12?
CREATE TABLE table_28210383_1 (original_air_date VARCHAR,prod_code VARCHAR)
SELECT original_air_date FROM table_28210383_1 WHERE prod_code = "2ACX12"
Who won the Men's Doubles when Guo Xin won the Women's Singles?
CREATE TABLE table_17506 ("Year" real,"Mens singles" text,"Womens singles" text,"Mens doubles" text,"Womens doubles" text,"Mixed doubles" text)
SELECT "Mens doubles" FROM table_17506 WHERE "Womens singles" = 'Guo Xin'
How many people voted in Cabarrus county?
CREATE TABLE table_20350118_1 (total INTEGER,county VARCHAR)
SELECT MIN(total) FROM table_20350118_1 WHERE county = "Cabarrus"
count the number of patients whose diagnoses short title is ventricular fibrillation and drug route is replace?
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 text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
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 = "Ventricular fibrillation" AND prescriptions.route = "REPLACE"
What is Ashton Cobb's class in Game 2?
CREATE TABLE table_38680 ("Position" text,"Number" real,"Name" text,"Height" text,"Weight" text,"Class" text,"Hometown" text,"Games\u2191" real)
SELECT "Class" FROM table_38680 WHERE "Games\u2191" = '2' AND "Name" = 'ashton cobb'
List the names of all the customers in alphabetical order.
CREATE TABLE customers (customer_details VARCHAR)
SELECT customer_details FROM customers ORDER BY customer_details
What is the average prom (m) when the height (m) is more than 733, the class is Hewitt, and the peak is Kirk Fell East Top?
CREATE TABLE table_name_75 (prom__m_ INTEGER,peak VARCHAR,height__m_ VARCHAR,class VARCHAR)
SELECT AVG(prom__m_) FROM table_name_75 WHERE height__m_ > 733 AND class = "hewitt" AND peak = "kirk fell east top"
What university team is referred to as the tigers?
CREATE TABLE table_2419754_1 (institution VARCHAR,nickname VARCHAR)
SELECT institution FROM table_2419754_1 WHERE nickname = "Tigers"
What dates contained matches at the venue Bourda?
CREATE TABLE table_79761 ("Date" text,"Home captain" text,"Away captain" text,"Venue" text,"Result" text)
SELECT "Date" FROM table_79761 WHERE "Venue" = 'bourda'
What is the Time of the swimmer from Chinese Taipei in Heat 3?
CREATE TABLE table_name_88 (time VARCHAR,nationality VARCHAR,heat VARCHAR,lane VARCHAR)
SELECT time FROM table_name_88 WHERE heat = 3 AND lane > 3 AND nationality = "chinese taipei"
What is Score, when Place is 'T8', and when Player is 'Orville Moody'?
CREATE TABLE table_43881 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Score" FROM table_43881 WHERE "Place" = 't8' AND "Player" = 'orville moody'
What is the highest grid that has gregorio lavilla as the rider?
CREATE TABLE table_name_89 (grid INTEGER,rider VARCHAR)
SELECT MAX(grid) FROM table_name_89 WHERE rider = "gregorio lavilla"
[ALPHA] [Favoritism - High Favorite <-> Score Correlation].
CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmoun...
SELECT p.Title AS "post_title", p.Tags AS "tags", p.Score AS "score", p.FavoriteCount AS "favorite", ('site://users/' + CAST(u1.Id AS TEXT) + '|' + u1.DisplayName) AS "poster", (SELECT MAX(v.CreationDate) FROM Votes AS v WHERE v.VoteTypeId = 5 AND v.PostId = p.Id) AS "last_favorite" FROM Posts AS p INNER JOIN Users AS ...
When did 'The Intervention' originally air?
CREATE TABLE table_26018 ("#" real,"Title" text,"Original airdate" text,"Timeslot" text,"Viewers (millions)" text,"Nightly rank" real,"Weekly rank" real)
SELECT "Original airdate" FROM table_26018 WHERE "Title" = 'The Intervention'
find the number of patients whose lab test named total protein, urine had lab test result as delta.
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 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 te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "delta" AND lab.label = "Total Protein, Urine"
Who directed the episode that was watched by 2.97 million U.S. viewers?
CREATE TABLE table_29920800_1 (directed_by VARCHAR,us_viewers__million_ VARCHAR)
SELECT directed_by FROM table_29920800_1 WHERE us_viewers__million_ = "2.97"
what is the number of patients with newborn primary disease who had pleural lab test?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND lab.fluid = "Pleural"
What is the average wins in 250cc class for Bultaco with 8 points later than 1966?
CREATE TABLE table_name_84 (wins INTEGER,points VARCHAR,year VARCHAR,class VARCHAR,team VARCHAR)
SELECT AVG(wins) FROM table_name_84 WHERE class = "250cc" AND team = "bultaco" AND year > 1966 AND points = 8
Name some imported commodities that are not found in the US.
CREATE TABLE resultsdata15 (sample_pk number,commod text,commtype text,lab text,pestcode text,testclass text,concen number,lod number,conunit text,confmethod text,confmethod2 text,annotate text,quantitate text,mean text,extract text,determin text)CREATE TABLE sampledata15 (sample_pk number,state text,year text,month te...
SELECT commod FROM sampledata15 WHERE origin = 2 AND NOT commod IN (SELECT commod FROM sampledata15 WHERE origin = 1)
When there is a lost of 2 what is the mumber drawn?
CREATE TABLE table_15405904_1 (drawn INTEGER,lost VARCHAR)
SELECT MAX(drawn) FROM table_15405904_1 WHERE lost = 2
What county has a Median family income of $37,667?
CREATE TABLE table_13556 ("County" text,"Per capita income" text,"Median household income" text,"Median family income" text,"Population" real,"Number of households" real)
SELECT "County" FROM table_13556 WHERE "Median family income" = '$37,667'
What is the interview score for the state of Virginia?
CREATE TABLE table_17631 ("State" text,"Preliminaries" text,"Interview" text,"Swimsuit" text,"Evening Gown" text,"Average" text)
SELECT "Interview" FROM table_17631 WHERE "State" = 'Virginia'
What is Darryl Fedorak's highest round?
CREATE TABLE table_34686 ("Round" real,"Player" text,"Position" text,"Nationality" text,"College/Junior/Club Team (League)" text)
SELECT MAX("Round") FROM table_34686 WHERE "Player" = 'darryl fedorak'
How many districts have Bart Stupak as the incumbent?
CREATE TABLE table_1341423_22 (district VARCHAR,incumbent VARCHAR)
SELECT COUNT(district) FROM table_1341423_22 WHERE incumbent = "Bart Stupak"
until 2102 how many patients were prescribed midazolam within 2 months after being diagnosed with hx-ven thrombosis/embols?
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)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_title text,long_title text)CREATE TABLE pres...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hx-ven thrombosis/...
What is Minister, when Party is 'AN'?
CREATE TABLE table_47619 ("Portfolio" text,"Minister" text,"Took office" text,"Left office" text,"Party" text)
SELECT "Minister" FROM table_47619 WHERE "Party" = 'an'
what drug was last given to patient 022-44805 since 01/2104?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientu...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-44805')) AND STRFTIME('%y-%m', medication.drugstarttime) >= '21...
What is the result of the game at Bishop Kearney Field on August 2?
CREATE TABLE table_53241 ("Date" text,"Opponent" text,"Home/Away" text,"Field" text,"Result" text)
SELECT "Result" FROM table_53241 WHERE "Field" = 'bishop kearney field' AND "Date" = 'august 2'
How many heights are listed for Jesse Holley in the WR position?
CREATE TABLE table_22603701_1 (height VARCHAR,position VARCHAR,name VARCHAR)
SELECT COUNT(height) FROM table_22603701_1 WHERE position = "WR" AND name = "Jesse Holley"
For R. Magjistari scores under 6, D. Tukiqi scores of 6, and ranks under 5, what is the average A. Krajka score?
CREATE TABLE table_51903 ("Draw" real,"Artist" text,"Song" text,"Rank" real,"Points" real,"A. Krajka" real,"Gj. Leka" real,"B. Haxhia" real,"D. Tukiqi" real,"R. Magjistari" real,"Gj. Xhuvani" real,"A. Sk\u00ebnderaj" real)
SELECT AVG("A. Krajka") FROM table_51903 WHERE "R. Magjistari" < '6' AND "D. Tukiqi" = '6' AND "Rank" < '5'
What is the Enrollment at Onalaska?
CREATE TABLE table_6869 ("Institution" text,"Location" text,"Affiliation" text,"Enrollment" real,"Mascot" text,"Colors" text)
SELECT MAX("Enrollment") FROM table_6869 WHERE "Location" = 'onalaska'
In what Year was the Result of the game 16-14?
CREATE TABLE table_name_81 (year INTEGER,result VARCHAR)
SELECT MAX(year) FROM table_name_81 WHERE result = "16-14"
List the distinct carriers of phones with memories bigger than 32.
CREATE TABLE phone (Carrier VARCHAR,Memory_in_G INTEGER)
SELECT DISTINCT Carrier FROM phone WHERE Memory_in_G > 32
How many cuts did Bernd Wiesberger make?
CREATE TABLE table_74295 ("Player" text,"Starts" real,"Cuts made" real,"Best finish" text,"Money list rank" real,"Earnings (\u20ac)" real)
SELECT "Cuts made" FROM table_74295 WHERE "Player" = 'Bernd Wiesberger'
If the catches is 131, what is the rank total number?
CREATE TABLE table_28282 ("Rank" real,"Dismissals" real,"Catches" real,"Stumps" real,"Player" text,"Period" text)
SELECT COUNT("Rank") FROM table_28282 WHERE "Catches" = '131'
What are the titles for courses with two prerequisites?
CREATE TABLE prereq (course_id text,prereq_id text)CREATE TABLE advisor (s_id text,i_id text)CREATE TABLE course (course_id text,title text,dept_name text,credits number)CREATE TABLE time_slot (time_slot_id text,day text,start_hr number,start_min number,end_hr number,end_min number)CREATE TABLE department (dept_name te...
SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING COUNT(*) = 2
What is the lowest grid number when Colin Edwards is the rider?
CREATE TABLE table_name_46 (grid INTEGER,rider VARCHAR)
SELECT MIN(grid) FROM table_name_46 WHERE rider = "colin edwards"
What is the total pick number of player curt bennett from canada with a draft before 1976 and a round less than 2?
CREATE TABLE table_name_32 (pick VARCHAR,round VARCHAR,player VARCHAR,nationality VARCHAR,draft VARCHAR)
SELECT COUNT(pick) FROM table_name_32 WHERE nationality = "canada" AND draft < 1976 AND player = "curt bennett" AND round < 2
What is the result of the game with 77,698 in attendance?
CREATE TABLE table_8203 ("Date" text,"Round" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" text,"Scorers" text)
SELECT "Result" FROM table_8203 WHERE "Attendance" = '77,698'
What was the amount in Staten Island when The Bronx was 1,281?
CREATE TABLE table_134 ("2013 Republican primary" text,"Manhattan" text,"The Bronx" text,"Brooklyn" text,"Queens" text,"Staten Island" text,"Total" real,"%" text)
SELECT "Staten Island" FROM table_134 WHERE "The Bronx" = '1,281'
For the English translation Someone Like You, what is the lowest draw?
CREATE TABLE table_13435 ("Draw" real,"Language" text,"Artist" text,"English translation" text,"Place" real,"Points" real)
SELECT MIN("Draw") FROM table_13435 WHERE "English translation" = 'someone like you'
What is the Score of the Player from South Africa?
CREATE TABLE table_name_64 (score VARCHAR,country VARCHAR)
SELECT score FROM table_name_64 WHERE country = "south africa"
How many goals were scored by the team that played less than 38 games, and had points of 47+9?
CREATE TABLE table_69489 ("Position" real,"Club" text,"Played" real,"Points" text,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Goal Difference" real)
SELECT MAX("Goals for") FROM table_69489 WHERE "Points" = '47+9' AND "Played" < '38'
Name the total number of seans team being 7x04
CREATE TABLE table_25937 ("Episode" text,"First broadcast" text,"Seans team" text,"Jasons team" text,"Scores" text)
SELECT COUNT("Seans team") FROM table_25937 WHERE "Episode" = '7x04'
What was the tournament that had byron black playing against magnus larsson?
CREATE TABLE table_66661 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Tournament" FROM table_66661 WHERE "Opponent" = 'magnus larsson'
How many papers has ras bodik written ?
CREATE TABLE field (fieldid int)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE...
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'ras bodik' AND writes.authorid = author.authorid
Who wrote the episodes directed by David Straiton?
CREATE TABLE table_21312845_1 (written_by VARCHAR,directed_by VARCHAR)
SELECT written_by FROM table_21312845_1 WHERE directed_by = "David Straiton"
What day was the winning score 16 (67-70-69-66=272)?
CREATE TABLE table_7849 ("Date" text,"Tournament" text,"Winning score" text,"Margin of victory" text,"Runner(s)-up" text)
SELECT "Date" FROM table_7849 WHERE "Winning score" = '–16 (67-70-69-66=272)'
what is the name of the drug that patient 5142 was prescribed within 2 days after it had been diagnosed the last month with esophageal reflux?
CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,...
SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 5142 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'esophag...
Top 20 Questions with high Score-To-ViewCount Ratio.
CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,U...
SELECT Questions.Id AS "post_link", Questions.ViewCount, Questions.Score AS Score, ROUND(1.0 * Questions.Score / Questions.ViewCount, 8) AS scTovc FROM Posts AS Answers INNER JOIN Posts AS Questions ON Questions.Id = Answers.ParentId WHERE Questions.ViewCount > 30000 GROUP BY Questions.Id, Questions.ViewCount, Question...
Which label has a catalog of y8hr 1006 in 1972?
CREATE TABLE table_47063 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text)
SELECT "Label" FROM table_47063 WHERE "Catalog" = 'y8hr 1006' AND "Date" = '1972'
Questions with score more than 100.
CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREAT...
SELECT * FROM Posts WHERE Score > 100
How many different season have an Army - Navy score of 10 dec. 2016 at Baltimore, MD (M&T Bank Stadium)?
CREATE TABLE table_22387 ("Season" real,"Trophy Winner" text,"Air Force \u2013 Navy score" text,"Air Force \u2013 Army score" text,"Army \u2013 Navy score" text)
SELECT COUNT("Season") FROM table_22387 WHERE "Army \u2013 Navy score" = '10 Dec. 2016 at Baltimore, MD (M&T Bank Stadium)'
Which Surface has a Date of 3 october 2003?
CREATE TABLE table_name_60 (surface VARCHAR,date VARCHAR)
SELECT surface FROM table_name_60 WHERE date = "3 october 2003"
when was patient 004-79017's last lab test done during this month?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid ...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-79017')) AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_T...
What was the result when there were 6 matches?
CREATE TABLE table_59412 ("Year" text,"Result" text,"Matches" text,"Wins" text,"Draws" text,"Losses" text)
SELECT "Result" FROM table_59412 WHERE "Matches" = '6'
How many total rounds were there at UFC 114?
CREATE TABLE table_name_30 (round VARCHAR,event VARCHAR)
SELECT COUNT(round) FROM table_name_30 WHERE event = "ufc 114"
How long was the fight 'adrenaline mma 3'?
CREATE TABLE table_name_72 (time VARCHAR,event VARCHAR)
SELECT time FROM table_name_72 WHERE event = "adrenaline mma 3"
How many people went to the game that lasted 2:37 after game 2?
CREATE TABLE table_name_54 (attendance INTEGER,game VARCHAR,time VARCHAR)
SELECT SUM(attendance) FROM table_name_54 WHERE game > 2 AND time = "2:37"
What is the latest stable release date for Crawltrack?
CREATE TABLE table_name_83 (latest_stable_release VARCHAR,name VARCHAR)
SELECT latest_stable_release FROM table_name_83 WHERE name = "crawltrack"
Name the numbers for the player with a height in ft of 6-7 for the guard
CREATE TABLE table_56339 ("Player" text,"No.(s)" text,"Height in Ft." text,"Position" text,"School/Club Team/Country" text)
SELECT "No.(s)" FROM table_56339 WHERE "Height in Ft." = '6-7' AND "Position" = 'guard'
How many 300 -level classes are being offered in Fall and Winter term ?
CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE semester (semester_id int,semester varchar,year ...
SELECT COUNT(DISTINCT course.course_id, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_id = course_offering.semester AND se...
The candidate who received 133 votes in the Bronx won what percentage overall?
CREATE TABLE table_135 ("1921" text,"party" text,"Manhattan" text,"The Bronx" text,"Brooklyn" text,"Queens" text,"Richmond [Staten Is.]" text,"Total" real,"%" text)
SELECT "%" FROM table_135 WHERE "The Bronx" = '133'
what are the five most frequently prescribed drugs that were prescribed to patients of the 40s within 2 months after they had been diagnosed with portal hypertension since 2103?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TAB...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 ...
How many laps did Innes Ireland make when he had a grid more than 15?
CREATE TABLE table_name_60 (laps VARCHAR,grid VARCHAR,driver VARCHAR)
SELECT laps FROM table_name_60 WHERE grid > 15 AND driver = "innes ireland"
Which Country has a Place of t1?
CREATE TABLE table_name_38 (country VARCHAR,place VARCHAR)
SELECT country FROM table_name_38 WHERE place = "t1"
WHAT IS THE LAPS WITH A GRID OF 26?
CREATE TABLE table_47683 ("Rider" text,"Manufacturer" text,"Laps" text,"Time/Retired" text,"Grid" text)
SELECT "Laps" FROM table_47683 WHERE "Grid" = '26'
What label uses the stereo LP for catalog scyl-934,623?
CREATE TABLE table_47060 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text)
SELECT "Label" FROM table_47060 WHERE "Format" = 'stereo lp' AND "Catalog" = 'scyl-934,623'
what's the total number of candidates for first elected in 1948 , 1964
CREATE TABLE table_18191 ("District" text,"Incumbent" text,"Party" text,"First elected" text,"Result" text,"Candidates" text)
SELECT COUNT("Candidates") FROM table_18191 WHERE "First elected" = '1948 , 1964'
How many grid numbers had a lap number bigger than 54?
CREATE TABLE table_name_89 (grid VARCHAR,laps INTEGER)
SELECT COUNT(grid) FROM table_name_89 WHERE laps > 54
What is the cardinal direction of Monday in English?
CREATE TABLE table_6620 ("Cardinal direction" text,"Burmese" text,"Sanskrit" text,"English" text,"Planet" text,"Sign" text)
SELECT "Cardinal direction" FROM table_6620 WHERE "English" = 'monday'
Display a bar chart for what are the names and budgets of departments with budgets greater than the average?
CREATE TABLE course (course_id varchar(8),title varchar(50),dept_name varchar(20),credits numeric(2,0))CREATE TABLE classroom (building varchar(15),room_number varchar(7),capacity numeric(4,0))CREATE TABLE advisor (s_ID varchar(5),i_ID varchar(5))CREATE TABLE time_slot (time_slot_id varchar(4),day varchar(1),start_hr n...
SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department)
Name the name for organization date being unknown
CREATE TABLE table_28105 ("Company" text,"Name" text,"County" text,"Militia Regiment" text,"Commander" text,"Organization Date" text)
SELECT "Name" FROM table_28105 WHERE "Organization Date" = 'Unknown'
What was the weekly rank by Virgin media for the title aired on May 20, 2010?
CREATE TABLE table_26826304_2 (weekly_rank_virgin_media INTEGER,air_date VARCHAR)
SELECT MIN(weekly_rank_virgin_media) FROM table_26826304_2 WHERE air_date = "May 20, 2010"
Count the number of regions.
CREATE TABLE affected_region (region_id number,storm_id number,number_city_affected number)CREATE TABLE storm (storm_id number,name text,dates_active text,max_speed number,damage_millions_usd number,number_deaths number)CREATE TABLE region (region_id number,region_code text,region_name text)
SELECT COUNT(*) FROM region
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and code , and group by attribute headquarter, show by the X in descending.
CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name DESC
which nation won the most silver medals mexico or spain ?
CREATE TABLE table_204_311 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT "nation" FROM table_204_311 WHERE "nation" IN ('mexico', 'spain') ORDER BY "silver" DESC LIMIT 1
the previous year, what are the top five most frequent diagnoses that patients were diagnosed with within 2 months after being diagnosed with depressive disorder nec?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE transfers (row_id number,subject_id numb...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions...