answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT directed_by FROM table_228973_11 WHERE original_air_date = "February 4, 2005"
Who directed the episode which originally aired February 4, 2005?
CREATE TABLE table_228973_11 (directed_by VARCHAR, original_air_date VARCHAR)
SELECT date FROM table_20745746_1 WHERE _number = "7"
What is the date of game 7?
CREATE TABLE table_20745746_1 (date VARCHAR, _number VARCHAR)
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) DESC
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the average of manager_id , and group by attribute job_id, and sort by the y axis in desc please.
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) )
SELECT COUNT(no_in_season) FROM table_228973_3 WHERE original_air_date = "January 3, 1997"
which is the number of the season episode whose premiere was in january 3, 1997?
CREATE TABLE table_228973_3 (no_in_season VARCHAR, original_air_date VARCHAR)
SELECT MAX(obama_number) FROM table_20750731_1 WHERE mccain_percentage = "64.4%"
What is the Obama# when McCain% is 64.4%?
CREATE TABLE table_20750731_1 (obama_number INTEGER, mccain_percentage VARCHAR)
SELECT official_name, status FROM city ORDER BY population DESC LIMIT 1
What is the official name and status of the city with the most residents?
CREATE TABLE farm_competition ( competition_id number, year number, theme text, host_city_id number, hosts text ) CREATE TABLE competition_record ( competition_id number, farm_id number, rank number ) CREATE TABLE city ( city_id number, official_name text, status text, area_km_2 number, population number, census_ranking text ) CREATE TABLE farm ( farm_id number, year number, total_horses number, working_horses number, total_cattle number, oxen number, bulls number, cows number, pigs number, sheep_and_goats number )
SELECT no_in_season FROM table_228973_3 WHERE written_by = "R. Scott Gemmill" AND directed_by = "Ray Austin"
which is the number of the season episode whose writer is R. Scott Gemmill and the Director is Ray Austin?
CREATE TABLE table_228973_3 (no_in_season VARCHAR, written_by VARCHAR, directed_by VARCHAR)
SELECT others_number FROM table_20750731_1 WHERE mccain_number = 4730
Name the Others# when McCain# is 4730.
CREATE TABLE table_20750731_1 (others_number VARCHAR, mccain_number VARCHAR)
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
For those employees who did not have any job in the past, draw a bar chart about the distribution of hire_date and the sum of salary bin hire_date by weekday.
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) )
SELECT title FROM table_228973_3 WHERE no_in_series = 31
what is the name of the episode whose number of the series episode was 31?
CREATE TABLE table_228973_3 (title VARCHAR, no_in_series VARCHAR)
SELECT county FROM table_20750731_1 WHERE obama_percentage = "41.7%"
What County was the Obama% at 41.7%?
CREATE TABLE table_20750731_1 (county VARCHAR, obama_percentage VARCHAR)
SELECT "Score" FROM table_67200 WHERE "Place" = 't6' AND "Player" = 'k.j. choi'
What is the score with a place of t6 for the player k.j. choi?
CREATE TABLE table_67200 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
SELECT written_by FROM table_228973_7 WHERE no_in_series = 129
When 129 is the number in the series who is the writer?
CREATE TABLE table_228973_7 (written_by VARCHAR, no_in_series VARCHAR)
SELECT others_number FROM table_20750731_1 WHERE mccain_percentage = "64.8%"
When McCain% was 64.8%, what is the Others#?
CREATE TABLE table_20750731_1 (others_number VARCHAR, mccain_percentage VARCHAR)
SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = "San Francisco State University" AND t1.year = 2000
In the year 2000, what is the campus fee for San Francisco State University?
CREATE TABLE campuses ( id number, campus text, location text, county text, year number ) CREATE TABLE enrollments ( campus number, year number, totalenrollment_ay number, fte_ay number ) CREATE TABLE discipline_enrollments ( campus number, discipline number, year number, undergraduate number, graduate number ) CREATE TABLE faculty ( campus number, year number, faculty number ) CREATE TABLE degrees ( year number, campus number, degrees number ) CREATE TABLE csu_fees ( campus number, year number, campusfee number )
SELECT MAX(prod__number) FROM table_2289806_1 WHERE episode__number = 1
How many product # have episode 1?
CREATE TABLE table_2289806_1 (prod__number INTEGER, episode__number VARCHAR)
SELECT obama_percentage FROM table_20750731_1 WHERE mccain_percentage = "61.2%"
What was the Obama% when McCain% was 61.2%?
CREATE TABLE table_20750731_1 (obama_percentage VARCHAR, mccain_percentage VARCHAR)
SELECT "Services" FROM table_75339 WHERE "Local authority" = 'chiltern' AND "Zone 2010" = '9'
Which Services have a Local authority of chiltern, and a Zone 2010 of 9?
CREATE TABLE table_75339 ( "Station" text, "Services" text, "Local authority" text, "Zone 2007" text, "Zone 2008" text, "Zone 2010" text, "Zone 2013" text )
SELECT windows_builders FROM table_22903426_1 WHERE name = "Apache Gump"
Name the windows builders for apache gump
CREATE TABLE table_22903426_1 (windows_builders VARCHAR, name VARCHAR)
SELECT date FROM table_20745759_1 WHERE attendance = 9372
Name the date for attendance 9372
CREATE TABLE table_20745759_1 (date VARCHAR, attendance VARCHAR)
SELECT "mountain peak" FROM table_204_25 WHERE "mountain peak" IN ('mount humphreys', 'mount kaweah') ORDER BY "elevation" DESC LIMIT 1
which is taller , mount humphreys or mount kaweah .
CREATE TABLE table_204_25 ( id number, "rank" number, "mountain peak" text, "mountain range" text, "elevation" text, "prominence" text, "isolation" text, "location" text )
SELECT COUNT(scm_system) FROM table_22903426_1 WHERE windows_builders = "NAnt, Visual Studio"
Name the number of scm system for nant, visual studio
CREATE TABLE table_22903426_1 (scm_system VARCHAR, windows_builders VARCHAR)
SELECT record FROM table_20745759_1 WHERE date = "January 18, 1997"
Name the record for january 18, 1997
CREATE TABLE table_20745759_1 (record VARCHAR, date VARCHAR)
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code ORDER BY COUNT(*)
Show all payment method codes and the number of orders for each code in a bar chart, show by the y axis from low to high please.
CREATE TABLE Ref_Payment_Methods ( payment_method_code CHAR(10), payment_method_description VARCHAR(80) ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15), Workshop_Group_ID INTEGER, Product_Description VARCHAR(255), Product_Name VARCHAR(255), Product_Price DECIMAL(20,4), Other_Product_Service_Details VARCHAR(255) ) CREATE TABLE Ref_Service_Types ( Service_Type_Code CHAR(15), Parent_Service_Type_Code CHAR(15), Service_Type_Description VARCHAR(255) ) CREATE TABLE Bookings ( Booking_ID INTEGER, Customer_ID INTEGER, Workshop_Group_ID VARCHAR(100), Status_Code CHAR(15), Store_ID INTEGER, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR(255) ) CREATE TABLE Customers ( Customer_ID VARCHAR(100), Address_ID INTEGER, Customer_Name VARCHAR(255), Customer_Phone VARCHAR(255), Customer_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Customer_Orders ( Order_ID INTEGER, Customer_ID INTEGER, Store_ID INTEGER, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR(255) ) CREATE TABLE Products ( Product_ID VARCHAR(100), Product_Name VARCHAR(255), Product_Price DECIMAL(20,4), Product_Description VARCHAR(255), Other_Product_Service_Details VARCHAR(255) ) CREATE TABLE Invoice_Items ( Invoice_Item_ID INTEGER, Invoice_ID INTEGER, Order_ID INTEGER, Order_Item_ID INTEGER, Product_ID INTEGER, Order_Quantity INTEGER, Other_Item_Details VARCHAR(255) ) CREATE TABLE Clients ( Client_ID INTEGER, Address_ID INTEGER, Customer_Email_Address VARCHAR(255), Customer_Name VARCHAR(255), Customer_Phone VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Performers_in_Bookings ( Order_ID INTEGER, Performer_ID INTEGER ) CREATE TABLE Performers ( Performer_ID INTEGER, Address_ID INTEGER, Customer_Name VARCHAR(255), Customer_Phone VARCHAR(255), Customer_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Addresses ( Address_ID VARCHAR(100), Line_1 VARCHAR(255), Line_2 VARCHAR(255), City_Town VARCHAR(255), State_County VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Order_Items ( Order_Item_ID INTEGER, Order_ID INTEGER, Product_ID INTEGER, Order_Quantity VARCHAR(288), Other_Item_Details VARCHAR(255) ) CREATE TABLE Bookings_Services ( Order_ID INTEGER, Product_ID INTEGER ) CREATE TABLE Stores ( Store_ID VARCHAR(100), Address_ID INTEGER, Marketing_Region_Code CHAR(15), Store_Name VARCHAR(255), Store_Phone VARCHAR(255), Store_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Marketing_Regions ( Marketing_Region_Code CHAR(15), Marketing_Region_Name VARCHAR(255), Marketing_Region_Descriptrion VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Invoices ( Invoice_ID INTEGER, Order_ID INTEGER, payment_method_code CHAR(15), Product_ID INTEGER, Order_Quantity VARCHAR(288), Other_Item_Details VARCHAR(255), Order_Item_ID INTEGER ) CREATE TABLE Drama_Workshop_Groups ( Workshop_Group_ID INTEGER, Address_ID INTEGER, Currency_Code CHAR(15), Marketing_Region_Code CHAR(15), Store_Name VARCHAR(255), Store_Phone VARCHAR(255), Store_Email_Address VARCHAR(255), Other_Details VARCHAR(255) )
SELECT COUNT(other_builders) FROM table_22903426_1 WHERE windows_builders = "NAnt, Visual Studio"
Name the number of other builders for nant, visual studio
CREATE TABLE table_22903426_1 (other_builders VARCHAR, windows_builders VARCHAR)
SELECT score FROM table_20745759_1 WHERE date = "March 29, 1997"
Name the score for march 29, 1997
CREATE TABLE table_20745759_1 (score VARCHAR, date VARCHAR)
SELECT place FROM table_name_28 WHERE player = "tony jacklin"
What Place has a Player of tony jacklin?
CREATE TABLE table_name_28 ( place VARCHAR, player VARCHAR )
SELECT MIN(2 AS nd_runner_up) FROM table_2290097_4
What is the minimum for 2nd runner-up?
CREATE TABLE table_2290097_4 (Id VARCHAR)
SELECT height__ft_ FROM table_20754016_2 WHERE country = "Honduras"
How tall is the contestant from Honduras?
CREATE TABLE table_20754016_2 (height__ft_ VARCHAR, country VARCHAR)
SELECT overall FROM table_name_49 WHERE player = "petter ronnquist"
When was petter ronnquist picked?
CREATE TABLE table_name_49 ( overall VARCHAR, player VARCHAR )
SELECT title FROM table_228973_9 WHERE original_air_date = "February 4, 2003"
If the original air date is February 4, 2003, what is the episode title?
CREATE TABLE table_228973_9 (title VARCHAR, original_air_date VARCHAR)
SELECT country FROM table_20754016_2 WHERE hometown = "Chihuahua"
What country is the contestant from Chihuahua from?
CREATE TABLE table_20754016_2 (country VARCHAR, hometown VARCHAR)
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 508 AND STRFTIME('%y', patient.unitadmittime) >= '2102'
tell me the total number of patients in the 508 wards since 2102?
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) 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 intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) 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 time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
SELECT no_in_series FROM table_228973_9 WHERE original_air_date = "April 1, 2003"
If the original air date is April 1, 2003, what number in the series is this episode?
CREATE TABLE table_228973_9 (no_in_series VARCHAR, original_air_date VARCHAR)
SELECT contestant FROM table_20754016_2 WHERE height__cm_ = 173
What contestant is 173 cm tall?
CREATE TABLE table_20754016_2 (contestant VARCHAR, height__cm_ VARCHAR)
SELECT "Crowd" FROM table_55855 WHERE "Home team" = 'footscray'
What is the Home team with a crowd relevant to footscray?
CREATE TABLE table_55855 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT MAX(no_in_series) FROM table_228973_9 WHERE directed_by = "Harvey S. Laidman"
What is the maximum number in the series for the episode directed by Harvey S. Laidman?
CREATE TABLE table_228973_9 (no_in_series INTEGER, directed_by VARCHAR)
SELECT country FROM table_20754016_2 WHERE hometown = "Salto"
What country is the contestant from Salto from?
CREATE TABLE table_20754016_2 (country VARCHAR, hometown VARCHAR)
SELECT "Final Score" FROM table_24603 WHERE "Opponent" = '@ Roughriders'
What was the final score when the game was @ roughriders?
CREATE TABLE table_24603 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Final Score" text, "Attendance" real, "Record" text )
SELECT original_air_date FROM table_22904752_1 WHERE written_by = "Sean Whitesell"
When is the original air date written by sean whitesell?
CREATE TABLE table_22904752_1 (original_air_date VARCHAR, written_by VARCHAR)
SELECT height__cm_ FROM table_20754016_2 WHERE country = "Guatemala"
How tall is the contestant from Guatemala?
CREATE TABLE table_20754016_2 (height__cm_ VARCHAR, country VARCHAR)
SELECT ring_name FROM table_1557974_1 WHERE current_rank = "f0 Jūryō 3 West"
Which ring names are currently ranked f0 j ry 3 west?
CREATE TABLE table_1557974_1 ( ring_name VARCHAR, current_rank VARCHAR )
SELECT directed_by FROM table_22904752_1 WHERE no = 79
Who is no. 79 directed by?
CREATE TABLE table_22904752_1 (directed_by VARCHAR, no VARCHAR)
SELECT MIN(enrollment) FROM table_2076463_2 WHERE location_s_ = "Springfield"
How much would you expect the enrollment to be in Springfield?
CREATE TABLE table_2076463_2 (enrollment INTEGER, location_s_ VARCHAR)
SELECT Country, COUNT(*) FROM stadium GROUP BY Country ORDER BY COUNT(*) DESC
How many stadiums does each country have Show bar chart, and rank by the Y-axis in descending.
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, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text )
SELECT COUNT(_number) FROM table_22904752_1 WHERE us_viewers__million_ = "17.44"
What is the # when u.s. viewers (million) is 17.44?
CREATE TABLE table_22904752_1 (_number VARCHAR, us_viewers__million_ VARCHAR)
SELECT location_s_ FROM table_2076463_2 WHERE control = "Public university" AND founded = 1915
where would you find a public university which was founded in 1915?
CREATE TABLE table_2076463_2 (location_s_ VARCHAR, control VARCHAR, founded VARCHAR)
SELECT COUNT(*), at.TagName FROM PostTags AS a JOIN PostTags AS b ON (a.PostId = b.PostId) JOIN Tags AS at ON (a.TagId = at.Id) JOIN Tags AS bt ON (b.TagId = bt.Id) WHERE bt.TagName = 'homework' AND at.TagName != 'homework' GROUP BY at.TagName ORDER BY 1 DESC
Tag associated with 'homework' tag.
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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) 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, ExcerptPostId number, WikiPostId number )
SELECT MAX(_number) FROM table_22904752_1 WHERE written_by = "David Hoselton"
How many # were written by david hoselton?
CREATE TABLE table_22904752_1 (_number INTEGER, written_by VARCHAR)
SELECT control FROM table_2076463_2 WHERE founded = 1873
What is the only type of university that was founded in 1873?
CREATE TABLE table_2076463_2 (control VARCHAR, founded VARCHAR)
SELECT SUM("Overall") FROM table_44162 WHERE "Round" = '3'
What is the overall sum of round 3?
CREATE TABLE table_44162 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
SELECT COUNT(race_3_winner) FROM table_22905641_2 WHERE race_2_winner = "Mitch Evans"
How many race 3 winners were there when Mitch Evans won race 2?
CREATE TABLE table_22905641_2 (race_3_winner VARCHAR, race_2_winner VARCHAR)
SELECT enrollment FROM table_2076463_2 WHERE location_s_ = "St. Louis"
What enrollement would you expect if you were attending the university in St. Louis?
CREATE TABLE table_2076463_2 (enrollment VARCHAR, location_s_ VARCHAR)
SELECT "Run 4" FROM table_77471 WHERE "Run 1" = '1:25.82'
Which Run 4 has a Run 1 of 1:25.82?
CREATE TABLE table_77471 ( "Team" text, "Athletes" text, "Run 1" text, "Run 2" text, "Run 3" text, "Run 4" text, "Final" text )
SELECT date FROM table_22905641_2 WHERE circuit = "Symmons Plains Raceway"
What date was the race at the Symmons Plains Raceway?
CREATE TABLE table_22905641_2 (date VARCHAR, circuit VARCHAR)
SELECT school FROM table_2076463_2 WHERE location_s_ = "Kirksville"
Which school would you come across if you were in Kirksville?
CREATE TABLE table_2076463_2 (school VARCHAR, location_s_ VARCHAR)
SELECT MIN(span_of_years_led) FROM table_23408094_14 WHERE tournament_at_which_lead_began = "Australian Championships"
Of the players whose lead began at the australian championships, what was the shortest span of years led?
CREATE TABLE table_23408094_14 ( span_of_years_led INTEGER, tournament_at_which_lead_began VARCHAR )
SELECT race_1_winner FROM table_22905641_2 WHERE circuit = "Winton Motor Raceway"
Who was the race 1 winner at the race held at Winton Motor Raceway?
CREATE TABLE table_22905641_2 (race_1_winner VARCHAR, circuit VARCHAR)
SELECT control FROM table_2076463_2 WHERE school = "Missouri Western State University"
What type of school would you see when visiting Missouri Western State University?
CREATE TABLE table_2076463_2 (control VARCHAR, school VARCHAR)
SELECT * FROM table_train_63 WHERE head_injury = 1 AND glasgow_come_score_gcs <= 5
head trauma with a glasgow come score ( gcs ) less or equal to 5
CREATE TABLE table_train_63 ( "id" int, "immune_suppression" bool, "leukocyte_count" int, "need_hemodialysis" bool, "head_injury" bool, "periodic_paralysis" bool, "renal_disease" bool, "glasgow_come_score_gcs" int, "sepsis" bool, "pancreatitis" bool, "enteral_feeding" bool, "age" float, "NOUSE" float )
SELECT race_1_winner FROM table_22905641_2 WHERE circuit = "Hidden Valley Raceway"
Who was the race 1 winner of the race at Hidden Valley Raceway?
CREATE TABLE table_22905641_2 (race_1_winner VARCHAR, circuit VARCHAR)
SELECT MAX(founded) FROM table_2076516_1 WHERE school = "East Carolina University"
When east carolina university is the school what is the highest year founded?
CREATE TABLE table_2076516_1 (founded INTEGER, school VARCHAR)
SELECT "division" FROM table_204_524 GROUP BY "division" ORDER BY COUNT(*) DESC LIMIT 1
which division were they in the most ?
CREATE TABLE table_204_524 ( id number, "season" text, "tier" number, "division" text, "place" text )
SELECT COUNT(year) FROM table_229059_2 WHERE champion = "Pat Bradley"
In how many years did Pat Bradley became the champion?
CREATE TABLE table_229059_2 (year VARCHAR, champion VARCHAR)
SELECT COUNT(enrollment__2012_) FROM table_2076516_1 WHERE founded = 1927
When 1927 is the founded year how many measurements of enrollment in 2012 are there?
CREATE TABLE table_2076516_1 (enrollment__2012_ VARCHAR, founded VARCHAR)
SELECT "title" FROM table_200_1 WHERE "role" = 'ms. monica'
what is the name of the movie where mischa barton plays the role of ms. monica ?
CREATE TABLE table_200_1 ( id number, "year" number, "title" text, "role" text, "notes" text )
SELECT dates FROM table_229059_2 WHERE tournament_location = "Forest Lake country Club"
When was the tournament in Forest Lake Country Club held?
CREATE TABLE table_229059_2 (dates VARCHAR, tournament_location VARCHAR)
SELECT control FROM table_2076516_1 WHERE school = "Western Carolina University"
When western carolina university is the school what is the control?
CREATE TABLE table_2076516_1 (control VARCHAR, school VARCHAR)
SELECT Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
For those records from the products and each product's manufacturer, a bar chart shows the distribution of headquarter and the average of manufacturer , and group by attribute headquarter.
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
SELECT COUNT(country) FROM table_229059_2 WHERE champion = "Se Ri Pak (2)"
How many different countries did the champion Se Ri Pak (2) represent?
CREATE TABLE table_229059_2 (country VARCHAR, champion VARCHAR)
SELECT MIN(enrollment__2012_) FROM table_2076516_1 WHERE school = "University of North Carolina at Charlotte"
When university of north carolina at charlotte is the school what is the lowest enrollment in 2012?
CREATE TABLE table_2076516_1 (enrollment__2012_ INTEGER, school VARCHAR)
SELECT production_company FROM table_name_61 WHERE producer_s_ = "sam mccarthy"
For which production company did Sam Mccarthy produce?
CREATE TABLE table_name_61 ( production_company VARCHAR, producer_s_ VARCHAR )
SELECT score FROM table_229059_2 WHERE year = 1978
What was the score in 1978?
CREATE TABLE table_229059_2 (score VARCHAR, year VARCHAR)
SELECT enrollment__fall_2010_ FROM table_2076522_2 WHERE location_s_ = "Bottineau"
What is the enrollment for the school in bottineau?
CREATE TABLE table_2076522_2 (enrollment__fall_2010_ VARCHAR, location_s_ VARCHAR)
SELECT login_name, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name
Return a bar chart about the distribution of login_name and author_id .
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) )
SELECT MIN(winners_share__) AS $_ FROM table_229059_2 WHERE champion = "Se Ri Pak (2)"
What was the winner share (in $) in the year when Se Ri Pak (2) was the champion?
CREATE TABLE table_229059_2 (winners_share__ INTEGER, champion VARCHAR)
SELECT control FROM table_2076522_2 WHERE accreditation = "The Higher Learning Commission ( NCA ), CCNE"
What is the control for the school accredited by the higher learning commission ( nca ), ccne?
CREATE TABLE table_2076522_2 (control VARCHAR, accreditation VARCHAR)
SELECT COUNT(golf) FROM table_16423070_4 WHERE soccer = "Wooster"
how many teams won at golf when wooster won soccer
CREATE TABLE table_16423070_4 ( golf VARCHAR, soccer VARCHAR )
SELECT score FROM table_229059_2 WHERE champion = "Jan Stephenson"
What was the score in the tournament won by Jan Stephenson?
CREATE TABLE table_229059_2 (score VARCHAR, champion VARCHAR)
SELECT MAX(founded) FROM table_2076522_2 WHERE enrollment__fall_2010_ = 898
What year was the school founded with an 898 enrollment?
CREATE TABLE table_2076522_2 (founded INTEGER, enrollment__fall_2010_ VARCHAR)
SELECT COUNT("Round") FROM table_78540 WHERE "Player" = 'tom morris'
Which round was Tom Morris picked in?
CREATE TABLE table_78540 ( "Round" real, "Pick" text, "Player" text, "Position" text, "School" text )
SELECT MIN(opp_points) FROM table_22903773_2 WHERE location = "Knoxville"
How many points did the opponents score at the game in Knoxville?
CREATE TABLE table_22903773_2 (opp_points INTEGER, location VARCHAR)
SELECT COUNT(accreditation) FROM table_2076522_2 WHERE founded = 2006
How many schools founded in 2006?
CREATE TABLE table_2076522_2 (accreditation VARCHAR, founded VARCHAR)
SELECT "Capital" FROM table_75904 WHERE "Hangul/Chosongul" = '경상남도'
Which capital has a Hangul of ?
CREATE TABLE table_75904 ( "RR Romaja" text, "M\u2013R Romaja" text, "Hangul/Chosongul" text, "Hanja" text, "Area" text, "Capital" text, "Region" text, "Country" text )
SELECT date FROM table_22903773_2 WHERE record = "17-7"
What game date had a record of 17-7?
CREATE TABLE table_22903773_2 (date VARCHAR, record VARCHAR)
SELECT accreditation FROM table_2076522_2 WHERE school = "United Tribes Technical College"
What is the accrediation for united tribes technical college?
CREATE TABLE table_2076522_2 (accreditation VARCHAR, school VARCHAR)
SELECT movements FROM table_29697744_1 WHERE position = "7th"
what is the name of the movement in the 7th position
CREATE TABLE table_29697744_1 ( movements VARCHAR, position VARCHAR )
SELECT MAX(opp_points) FROM table_22903773_2 WHERE record = "16-5"
How many points did the opponents score on the game where Sooners' record was 16-5?
CREATE TABLE table_22903773_2 (opp_points INTEGER, record VARCHAR)
SELECT MAX(founded) FROM table_2076490_1
What is the latest founding date?
CREATE TABLE table_2076490_1 (founded INTEGER)
SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Date_in_Locaton_To
Show the number of documents in different ending date and group by ending date with a line chart.
CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME, Day_Number INTEGER ) CREATE TABLE Roles ( Role_Code CHAR(15), Role_Name VARCHAR(255), Role_Description VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Document_Locations ( Document_ID INTEGER, Location_Code CHAR(15), Date_in_Location_From DATETIME, Date_in_Locaton_To DATETIME ) CREATE TABLE All_Documents ( Document_ID INTEGER, Date_Stored DATETIME, Document_Type_Code CHAR(15), Document_Name CHAR(255), Document_Description CHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Employees ( Employee_ID INTEGER, Role_Code CHAR(15), Employee_Name VARCHAR(255), Gender_MFU CHAR(1), Date_of_Birth DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Ref_Locations ( Location_Code CHAR(15), Location_Name VARCHAR(255), Location_Description VARCHAR(255) ) CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME, Actual_Destruction_Date DATETIME, Other_Details VARCHAR(255) )
SELECT COUNT(title) FROM table_22904780_1 WHERE us_viewers__million_ = "12.04"
List the number of shows that had 12.04 million viewers in the united states
CREATE TABLE table_22904780_1 (title VARCHAR, us_viewers__million_ VARCHAR)
SELECT enrollment__2005_ FROM table_2076490_1 WHERE type = "Baccalaureate college" AND school = "Granite State College"
What was the enrollment (2005) for baccalaureate colleges , for Granite State College?
CREATE TABLE table_2076490_1 (enrollment__2005_ VARCHAR, type VARCHAR, school VARCHAR)
SELECT second FROM table_name_35 WHERE nation = "united states"
Who was second for the United States team?
CREATE TABLE table_name_35 ( second VARCHAR, nation VARCHAR )
SELECT original_air_date FROM table_22904780_1 WHERE rank__week_ = 5
List the original air date for week 5.
CREATE TABLE table_22904780_1 (original_air_date VARCHAR, rank__week_ VARCHAR)
SELECT founded FROM table_2076490_1 WHERE enrollment__2005_ = "963"
What year is the founding year, for the school that had an enrollment in 2005 of 963?
CREATE TABLE table_2076490_1 (founded VARCHAR, enrollment__2005_ VARCHAR)
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code) OR (date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND NOT ((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time))) AND flight.arrival_time <= 1800) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEW YORK' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CINCINNATI' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
please find all the flights from CINCINNATI to any airport in the NEW YORK area that arrive next saturday before 1800
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) 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 time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) 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 fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE code_description ( code varchar, description text )
SELECT original_air_date FROM table_22904780_1 WHERE written_by = "Russel Friend & Garrett Lerner"
List the 1st air date for the show where the writers are russel friend & garrett lerner.
CREATE TABLE table_22904780_1 (original_air_date VARCHAR, written_by VARCHAR)
SELECT school FROM table_2076490_1 WHERE enrollment__2005_ = "69"
What school had an enrollment in 2005 of 69?
CREATE TABLE table_2076490_1 (school VARCHAR, enrollment__2005_ VARCHAR)
SELECT COUNT("Result") FROM table_28484 WHERE "Original artist" = 'Alicia Keys'
How many times is the original artist Alicia keys?
CREATE TABLE table_28484 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
SELECT graphical FROM table_22915134_2 WHERE example = "Shinya Nakano's Kawasaki Ninja ZX-RR"
When shinya nakano's kawasaki ninja zx-rr is the example what is the graphical?
CREATE TABLE table_22915134_2 (graphical VARCHAR, example VARCHAR)