answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT pick__number FROM table_name_31 WHERE round = "round 8"
What is the pick number for the player(s) drafted in round 8?
CREATE TABLE table_name_31 ( pick__number VARCHAR, round VARCHAR )
SELECT COUNT(mountains_classification) FROM table_25999087_2 WHERE winner = "Rui Costa"
How many mountains classifications when Rui Costa is the winner?
CREATE TABLE table_25999087_2 (mountains_classification VARCHAR, winner VARCHAR)
SELECT city FROM table_name_49 WHERE year < 1907 AND venue = "old trafford" AND opposition = "sussex"
Which city held the game in Old Trafford before 1907 when the Opposition was sussex?
CREATE TABLE table_name_49 (city VARCHAR, opposition VARCHAR, year VARCHAR, venue VARCHAR)
SELECT c__nf_km_ FROM table_261642_3 WHERE r__ω_km_ = "463.59"
What is the c (nf/km) when the r ( /km) is 463.59?
CREATE TABLE table_261642_3 ( c__nf_km_ VARCHAR, r__ω_km_ VARCHAR )
SELECT team_classification FROM table_25999087_2 WHERE points_classification = "Philippe Gilbert" AND mountains_classification = "Johnny Hoogerland" AND stage < 9.0
What is every team classification when points classification is Philippe Gilbert if mountains classification is Johnny Hoogerland and stage is less than 9.0?
CREATE TABLE table_25999087_2 (team_classification VARCHAR, stage VARCHAR, points_classification VARCHAR, mountains_classification VARCHAR)
SELECT score FROM table_name_49 WHERE opposition = "sussex" AND year > 1890
What was the score when the opposition was sussex after 1890?
CREATE TABLE table_name_49 (score VARCHAR, opposition VARCHAR, year VARCHAR)
SELECT MAX("Attendance") FROM table_79895 WHERE "Date" = 'august 28'
What was the Attendance high on August 28?
CREATE TABLE table_79895 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
SELECT us_viewers__million_ FROM table_25997153_1 WHERE directed_by = "Dan Lerner"
how many million u.s. viewers watched the episode directed by dan lerner?
CREATE TABLE table_25997153_1 (us_viewers__million_ VARCHAR, directed_by VARCHAR)
SELECT city FROM table_name_76 WHERE year > 1907 AND score > 20 AND venue = "aigburth"
What city had a score of 20 in aigburth after 1907?
CREATE TABLE table_name_76 (city VARCHAR, venue VARCHAR, year VARCHAR, score VARCHAR)
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, flight WHERE ((flight.departure_time <= 1900 AND flight.departure_time >= 1700) AND ((flight.to_airport = AIRPORT_SERVICE_2.airport_code AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'SAN FRANCISCO') OR (flight.to_airport = AIRPORT_SERVICE_3.airport_code AND CITY_3.city_code = AIRPORT_SERVICE_3.city_code AND CITY_3.city_name = 'OAKLAND'))) AND (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS FORT WORTH' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code)
show me all the flights between DALLAS FORT WORTH and either SAN FRANCISCO or OAKLAND that depart between 1700 and 1900
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 ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) 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 equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) 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 days ( days_code varchar, day_name varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description 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 airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) 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 dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) 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 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 compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar )
SELECT MAX(no_in_series) FROM table_25997153_1 WHERE us_viewers__million_ = "16.17"
what is the latest episode in the series that had 16.17 million u.s. viewers?
CREATE TABLE table_25997153_1 (no_in_series INTEGER, us_viewers__million_ VARCHAR)
SELECT SUM(score) FROM table_name_96 WHERE opposition = "sussex" AND city = "liverpool"
What was the score when the opposition was sussex in liverpool?
CREATE TABLE table_name_96 (score INTEGER, opposition VARCHAR, city VARCHAR)
SELECT COUNT(1) AS nbe_answers, Questions.OwnerUserId AS "user_link", AVG(Answers.Score) AS A_score, AVG(Questions.Score) AS Q_score FROM Posts AS Questions, Posts AS Answers WHERE Questions.PostTypeId = 1 AND Answers.PostTypeId = 2 AND Answers.ParentId = Questions.Id AND Answers.OwnerUserId = '##UserId1##' GROUP BY Questions.OwnerUserId ORDER BY nbe_answers DESC
To whom do I answer on average?.
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) 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 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 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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress 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 PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostTags ( PostId number, TagId number ) 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 Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) 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 ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description 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, UserId number, ContentLicense text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
SELECT title FROM table_25997153_1 WHERE production_code = "3X5362"
What is the title of the episode with the production code 3x5362?
CREATE TABLE table_25997153_1 (title VARCHAR, production_code VARCHAR)
SELECT producer FROM table_name_57 WHERE director = "erik matti"
What is Director Erik Matti's Producer?
CREATE TABLE table_name_57 (producer VARCHAR, director VARCHAR)
SELECT decision FROM table_name_71 WHERE visitor = "chicago"
What was the decision of the Kings game when Chicago was the visiting team?
CREATE TABLE table_name_71 ( decision VARCHAR, visitor VARCHAR )
SELECT MIN(nsg_nr) FROM table_26013618_1 WHERE date_established = "19961220 20.12.1996"
What Nature reserve number was established on 19961220 20.12.1996
CREATE TABLE table_26013618_1 (nsg_nr INTEGER, date_established VARCHAR)
SELECT producer FROM table_name_32 WHERE director = "bona fajardo"
What is Director Bona Fajardo's Producer?
CREATE TABLE table_name_32 (producer VARCHAR, director VARCHAR)
SELECT "Span" FROM table_51348 WHERE "Drop" = '0'
which spans had a drop of 0?
CREATE TABLE table_51348 ( "Player" text, "Span" text, "Start" text, "Tries" text, "Conv" text, "Pens" text, "Drop" text )
SELECT COUNT(nsg_nr) FROM table_26013618_1 WHERE date_established = "19740329 29.03.1974"
How many reserves were established on 19740329 29.03.1974?
CREATE TABLE table_26013618_1 (nsg_nr VARCHAR, date_established VARCHAR)
SELECT producer FROM table_name_77 WHERE year = "december 25, 2006"
What is the Producer on December 25, 2006?
CREATE TABLE table_name_77 (producer VARCHAR, year VARCHAR)
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY All_Home
Show me about the distribution of All_Home and Team_ID , and group by attribute ACC_Home in a bar chart, and rank x-axis from low to high 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_Percent int, All_Home text, All_Road text, All_Neutral text )
SELECT date_established FROM table_26013618_1 WHERE name_of_the_nature_reserve = "Stellbrookmoor"
When was Stellbrookmoor established?
CREATE TABLE table_26013618_1 (date_established VARCHAR, name_of_the_nature_reserve VARCHAR)
SELECT title FROM table_name_79 WHERE role = "mylene"
What Title has a Role of Mylene?
CREATE TABLE table_name_79 (title VARCHAR, role VARCHAR)
SELECT DATE(v.CreationDate) FROM Users AS u INNER JOIN Votes AS v ON v.UserId = u.Id WHERE u.Id IN (2, 3, 66, 121, 1409, 2000, 2926) GROUP BY DATE(v.CreationDate) ORDER BY DATE(v.CreationDate) DESC
Days with at least one vote by Mathematics moderators.
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) 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 ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) 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 PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) 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 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 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 PostHistoryTypes ( Id number, Name 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 PostTags ( PostId number, TagId 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 FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
SELECT district___town FROM table_26013618_1 WHERE area__ha_ = "163,62"
What town has the reserve with an area of 163,62?
CREATE TABLE table_26013618_1 (district___town VARCHAR, area__ha_ VARCHAR)
SELECT year FROM table_name_55 WHERE role = "(cameo)"
In what Year is there a Role of (cameo)?
CREATE TABLE table_name_55 (year VARCHAR, role VARCHAR)
SELECT T1.Area FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING T2.year < 2010 ORDER BY COUNT(*) DESC LIMIT 1
What is the area of the appelation that produces the highest number of wines before the year of 2010?
CREATE TABLE APPELLATIONS ( Area VARCHAR, Appelation VARCHAR ) CREATE TABLE WINE ( Appelation VARCHAR, year VARCHAR )
SELECT COUNT(nsg_nr) FROM table_26013618_1 WHERE district___town = "Herzogtum Lauenburg" AND area__ha_ = "123,14"
How many reserves are in Herzogtum Lauenburg with an area of 123,14?
CREATE TABLE table_26013618_1 (nsg_nr VARCHAR, district___town VARCHAR, area__ha_ VARCHAR)
SELECT date FROM table_name_57 WHERE result = "106-105"
On what date was the result 106-105?
CREATE TABLE table_name_57 (date VARCHAR, result VARCHAR)
SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY Name DESC
How many exhibitions has each artist had Plot them as bar chart, I want to order bar in desc order please.
CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real )
SELECT COUNT(name_of_the_nature_reserve) FROM table_26013618_1 WHERE nsg_nr = 54
How many names does nature reserve 54 have?
CREATE TABLE table_26013618_1 (name_of_the_nature_reserve VARCHAR, nsg_nr VARCHAR)
SELECT result FROM table_name_26 WHERE home_team = "portland" AND date = "june 12"
What was the result for Portland at home on June 12?
CREATE TABLE table_name_26 (result VARCHAR, home_team VARCHAR, date VARCHAR)
SELECT demographic.dob, demographic.gender FROM demographic WHERE demographic.name = "Bessie Giordano"
provide the date of birth and gender of the subject name bessie giordano.
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid 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 text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear 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 )
SELECT title FROM table_25996938_1 WHERE us_viewers__million_ = "18.74"
Which episode did 18.74 million people tune in?
CREATE TABLE table_25996938_1 (title VARCHAR, us_viewers__million_ VARCHAR)
SELECT home_team FROM table_name_32 WHERE result = "105-99"
Who was the home team with a result of 105-99?
CREATE TABLE table_name_32 (home_team VARCHAR, result VARCHAR)
SELECT * FROM table_train_85 WHERE mini_mental_state_examination_mmse < 25
mini _ mental status exam score < 25 .
CREATE TABLE table_train_85 ( "id" int, "mini_mental_state_examination_mmse" int, "elevated_serum_phenylalanine" int, "elevated_creatinine" float, "renal_disease" bool, "geriatric_depression_scale_gds" int, "NOUSE" float )
SELECT production_code FROM table_25996938_1 WHERE no_in_series = 11
Which prod code was series 11?
CREATE TABLE table_25996938_1 (production_code VARCHAR, no_in_series VARCHAR)
SELECT date FROM table_name_54 WHERE game = "game 1"
On what date was Game 1?
CREATE TABLE table_name_54 (date VARCHAR, game VARCHAR)
SELECT "Tie no" FROM table_65346 WHERE "Home team" = 'wimbledon'
What is the Tie no when Wimbledon is the home team?
CREATE TABLE table_65346 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
SELECT MAX(localities) FROM table_26007767_1
What is the highest localities?
CREATE TABLE table_26007767_1 (localities INTEGER)
SELECT date FROM table_name_2 WHERE game = "game 3"
On what date was Game 3?
CREATE TABLE table_name_2 (date VARCHAR, game VARCHAR)
SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) DESC
Find the number of courses for each subject in a bar chart, and I want to list in descending by the y-axis.
CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result 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 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) ) CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) )
SELECT MIN(arabs) FROM table_26007767_1 WHERE metropolitan_ring = "Inner Ring 3"
What is the least arabs when the metropolitan ring is inner ring 3?
CREATE TABLE table_26007767_1 (arabs INTEGER, metropolitan_ring VARCHAR)
SELECT date FROM table_name_95 WHERE road_team = "portland" AND game = "game 2"
On what date was Portland on the road for Game 2?
CREATE TABLE table_name_95 (date VARCHAR, road_team VARCHAR, game VARCHAR)
SELECT state FROM table_name_9 WHERE name = "dai"
Which state was Dai from?
CREATE TABLE table_name_9 ( state VARCHAR, name VARCHAR )
SELECT COUNT(localities) FROM table_26007767_1 WHERE population_density__per_km²_ = "2.5"
How many time is the population density (per km²) is 2.5?
CREATE TABLE table_26007767_1 (localities VARCHAR, population_density__per_km²_ VARCHAR)
SELECT MAX(played) FROM table_name_27 WHERE against > 14 AND lost = 3
What was the highest number of games played when they had over 14 against and 3 losses?
CREATE TABLE table_name_27 (played INTEGER, against VARCHAR, lost VARCHAR)
SELECT COUNT("Losses") FROM table_66363 WHERE "Points" = '11'
How many losses have 11 points?
CREATE TABLE table_66363 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real )
SELECT COUNT(stage) FROM table_26010857_13 WHERE teams_classification = "Cervélo TestTeam"
What is the number of stages where the teams classification leader is Cervélo Testteam?
CREATE TABLE table_26010857_13 (stage VARCHAR, teams_classification VARCHAR)
SELECT AVG(position) FROM table_name_90 WHERE team = "corinthians" AND against > 14
What was the position for team corinthians with over 14 against?
CREATE TABLE table_name_90 (position INTEGER, team VARCHAR, against VARCHAR)
SELECT "Name" FROM table_63396 WHERE "Constituency number" = '84'
Who has a constituency of 84?
CREATE TABLE table_63396 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real )
SELECT MAX(stage) FROM table_26010857_13 WHERE teams_classification = "Team Sky"
How many stages did Team Sky lead the teams classification?
CREATE TABLE table_26010857_13 (stage INTEGER, teams_classification VARCHAR)
SELECT MAX(played) FROM table_name_19 WHERE against < 15 AND team = "bangu" AND points > 9
How many games played for team bangu with under 15 against, and over 9 points?
CREATE TABLE table_name_19 (played INTEGER, points VARCHAR, against VARCHAR, team VARCHAR)
SELECT "Years" FROM table_65043 WHERE "Soap Opera" = 'marienhof' AND "Duration" = '10 years' AND "Actor" = 'leonore capell'
What years did Marienhof run, which featured Leonore Capell and lasted 10 years?
CREATE TABLE table_65043 ( "Actor" text, "Character" text, "Soap Opera" text, "Years" text, "Duration" text )
SELECT general_classification FROM table_26010857_13 WHERE stage = 3
Who leads the general classification in stage 3?
CREATE TABLE table_26010857_13 (general_classification VARCHAR, stage VARCHAR)
SELECT date FROM table_name_55 WHERE opponent = "northern ireland"
When is Northern Ireland the opponent?
CREATE TABLE table_name_55 (date VARCHAR, opponent VARCHAR)
SELECT streak FROM table_30047613_13 WHERE date = "May 9"
How many games had they won or lost in a row on May 9?
CREATE TABLE table_30047613_13 ( streak VARCHAR, date VARCHAR )
SELECT COUNT(prod_code) FROM table_2602958_4 WHERE no = 45
How many production codes are there for episode number 45?
CREATE TABLE table_2602958_4 (prod_code VARCHAR, no VARCHAR)
SELECT length FROM table_name_27 WHERE class = "gts-2" AND date = "october 8"
Name the length for class of gts-2 and date of october 8
CREATE TABLE table_name_27 (length VARCHAR, class VARCHAR, date VARCHAR)
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'opium tincture' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE DATETIME(t1.startdate) = DATETIME(t2.startdate) GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 4
what were the four most frequent prescriptions of medications for patients who were also prescribed opium tincture at the same time a year before?
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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 icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title 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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number )
SELECT writer_s_ FROM table_2602958_4 WHERE _number = 6
Who wrote episode 6 in season 3?
CREATE TABLE table_2602958_4 (writer_s_ VARCHAR, _number VARCHAR)
SELECT circuit FROM table_name_78 WHERE class = "gts"
Name the circuit with class of gts
CREATE TABLE table_name_78 (circuit VARCHAR, class VARCHAR)
SELECT mID, AVG(stars) FROM Rating WHERE NOT mID IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = "Brittany Harris") GROUP BY mID
Find the average rating star for each movie that are not reviewed by Brittany Harris.
CREATE TABLE Rating ( mID VARCHAR, stars INTEGER ) CREATE TABLE Reviewer ( rID VARCHAR, name VARCHAR )
SELECT _number FROM table_2602958_4 WHERE prod_code = 175020
Which episodein season 3 had 175020 for a production code?
CREATE TABLE table_2602958_4 (_number VARCHAR, prod_code VARCHAR)
SELECT length FROM table_name_63 WHERE class = "all" AND date = "march 18"
Name the length for all class and date of march 18
CREATE TABLE table_name_63 (length VARCHAR, class VARCHAR, date VARCHAR)
SELECT "League" FROM table_73329 WHERE "Year" = '2010'
What league was involved in 2010?
CREATE TABLE table_73329 ( "Year" real, "Division" real, "League" text, "Reg. Season" text, "Playoffs" text, "National Open" text )
SELECT writer_s_ FROM table_2602958_4 WHERE no = 45
Who wrote episode number 45?
CREATE TABLE table_2602958_4 (writer_s_ VARCHAR, no VARCHAR)
SELECT COUNT(game) FROM table_name_55 WHERE team = "chicago"
How many Games has a Team of chicago?
CREATE TABLE table_name_55 (game VARCHAR, team VARCHAR)
SELECT Date, COUNT(Date) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Date ORDER BY COUNT(Date)
For each record in schedule, show the number of films for each day in a bar chart, display by the y axis in ascending.
CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float )
SELECT us_viewers__million_ FROM table_2602958_3 WHERE no = 38
How many viewers in millions for episode number 38?
CREATE TABLE table_2602958_3 (us_viewers__million_ VARCHAR, no VARCHAR)
SELECT high_points FROM table_name_55 WHERE high_rebounds = "charles oakley , kevin willis (11)"
What is the High points of charles oakley , kevin willis (11)?
CREATE TABLE table_name_55 (high_points VARCHAR, high_rebounds VARCHAR)
SELECT MIN(merconorte) FROM table_name_92 WHERE interliga = 2 AND matches > 260 AND superliga > 7
Name the least merconorte for interliga of 2 and matches more than 260 with superliga more than 7
CREATE TABLE table_name_92 ( merconorte INTEGER, superliga VARCHAR, interliga VARCHAR, matches VARCHAR )
SELECT director FROM table_2602958_3 WHERE prod_code = 227451
Who directed the episode with production code 227451?
CREATE TABLE table_2602958_3 (director VARCHAR, prod_code VARCHAR)
SELECT game FROM table_name_40 WHERE score = "w 90–82 (ot)"
Which Game has a Score of w 90–82 (ot)?
CREATE TABLE table_name_40 (game VARCHAR, score VARCHAR)
SELECT pole_position FROM table_1140074_2 WHERE location = "Hockenheimring"
what's the pole position with location being hockenheimring
CREATE TABLE table_1140074_2 ( pole_position VARCHAR, location VARCHAR )
SELECT original_air_date FROM table_2602958_3 WHERE director = "Kevin Dowling"
What is the original air date for the episode directed by kevin dowling?
CREATE TABLE table_2602958_3 (original_air_date VARCHAR, director VARCHAR)
SELECT high_rebounds FROM table_name_43 WHERE team = "washington"
What is the High rebounds of washington Team?
CREATE TABLE table_name_43 (high_rebounds VARCHAR, team VARCHAR)
SELECT decision FROM table_name_49 WHERE attendance > 19 OFFSET 883
What is the decision of the game with an attendance greater than 19,883?
CREATE TABLE table_name_49 ( decision VARCHAR, attendance INTEGER )
SELECT ba___running_bear FROM table_2603017_2 WHERE b___bishop = "RN - Running Stag"
what is ba - running bear where b - bishop is rn - running stag?
CREATE TABLE table_2603017_2 (ba___running_bear VARCHAR, b___bishop VARCHAR)
SELECT SUM(game) FROM table_name_52 WHERE date = "february 28"
What is the sum of Game on february 28?
CREATE TABLE table_name_52 (game INTEGER, date VARCHAR)
SELECT winner FROM table_name_59 WHERE runner_up = "kimberly kim" AND country = "united states"
Who was the winner from the United States the year Kimberly Kim was runner-up?
CREATE TABLE table_name_59 ( winner VARCHAR, runner_up VARCHAR, country VARCHAR )
SELECT b___bishop FROM table_2603017_2 WHERE ab___angry_boar = "VW - Vertical Wolf"
what is b - bishop where ab - angry boar is vw - vertical wolf?
CREATE TABLE table_2603017_2 (b___bishop VARCHAR, ab___angry_boar VARCHAR)
SELECT country FROM table_name_71 WHERE wins > 2
Which Country has a number of Wins larger than 2?
CREATE TABLE table_name_71 (country VARCHAR, wins INTEGER)
SELECT team FROM table_23183195_2 WHERE overall_record = "22-11"
What team's overal record is 22-11?
CREATE TABLE table_23183195_2 ( team VARCHAR, overall_record VARCHAR )
SELECT ba___running_bear FROM table_2603017_2 WHERE ab___angry_boar = "OS - Ox Soldier"
what is ba - running bear where ab - angry boar is os - ox soldier?
CREATE TABLE table_2603017_2 (ba___running_bear VARCHAR, ab___angry_boar VARCHAR)
SELECT ranking FROM table_name_95 WHERE nationality = "spain" AND goals = 26
What ranking has the nationality of spain and the goals of 26?
CREATE TABLE table_name_95 (ranking VARCHAR, nationality VARCHAR, goals VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.religion = "PROTESTANT QUAKER" AND procedures.short_title = "Int insert 1-cham, rate"
how many patients of protestant quaker religion are procedured with int insert 1-cham, rate?
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 text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title 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 )
SELECT b___bishop FROM table_2603017_2 WHERE bc___beast_cadet = "GR - Great Dove"
what is b - bishop where bc - beast cadet is gr - great dove?
CREATE TABLE table_2603017_2 (b___bishop VARCHAR, bc___beast_cadet VARCHAR)
SELECT name FROM table_name_18 WHERE goals = 25
What name is the goals of 25?
CREATE TABLE table_name_18 (name VARCHAR, goals VARCHAR)
SELECT series FROM table_name_2 WHERE game > 4
What was the series standing for games over 4?
CREATE TABLE table_name_2 ( series VARCHAR, game INTEGER )
SELECT bb___blind_bear FROM table_2603017_2 WHERE ba___running_bear = "MF - Mountain Falcon"
what is bb - blind bear where ba - running bear is mf - mountain falcon?
CREATE TABLE table_2603017_2 (bb___blind_bear VARCHAR, ba___running_bear VARCHAR)
SELECT COUNT(grid) FROM table_name_59 WHERE time = "+37.949"
what's the grid with time +37.949?
CREATE TABLE table_name_59 (grid VARCHAR, time VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "30390" AND lab."CATEGORY" = "Blood Gas"
calculate the total number of patients diagnosed with icd9 code 30390 who had their blood gas tested by lab
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, 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 text, admittime text, dischtime text, admityear 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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
SELECT bb___blind_bear FROM table_2603017_2 WHERE ba___running_bear = "TC - Tile Chariot"
what is bb - blind bear where ba - running bear is tc - tile chariot?
CREATE TABLE table_2603017_2 (bb___blind_bear VARCHAR, ba___running_bear VARCHAR)
SELECT driver FROM table_name_80 WHERE grid = 12
what driver has 12 in grid?
CREATE TABLE table_name_80 (driver VARCHAR, grid VARCHAR)
SELECT date_to, COUNT(date_to) FROM Project_Staff ORDER BY date_to DESC
Plot date to by the number of date to as a trend line, and sort by the x-axis from high to low.
CREATE TABLE Documents ( document_id INTEGER, document_type_code VARCHAR(10), grant_id INTEGER, sent_date DATETIME, response_received_date DATETIME, other_details VARCHAR(255) ) CREATE TABLE Organisation_Types ( organisation_type VARCHAR(10), organisation_type_description VARCHAR(255) ) CREATE TABLE Projects ( project_id INTEGER, organisation_id INTEGER, project_details VARCHAR(255) ) CREATE TABLE Research_Outcomes ( outcome_code VARCHAR(10), outcome_description VARCHAR(255) ) CREATE TABLE Research_Staff ( staff_id INTEGER, employer_organisation_id INTEGER, staff_details VARCHAR(255) ) CREATE TABLE Organisations ( organisation_id INTEGER, organisation_type VARCHAR(10), organisation_details VARCHAR(255) ) CREATE TABLE Document_Types ( document_type_code VARCHAR(10), document_description VARCHAR(255) ) CREATE TABLE Project_Staff ( staff_id DOUBLE, project_id INTEGER, role_code VARCHAR(10), date_from DATETIME, date_to DATETIME, other_details VARCHAR(255) ) CREATE TABLE Project_Outcomes ( project_id INTEGER, outcome_code VARCHAR(10), outcome_details VARCHAR(255) ) CREATE TABLE Staff_Roles ( role_code VARCHAR(10), role_description VARCHAR(255) ) CREATE TABLE Tasks ( task_id INTEGER, project_id INTEGER, task_details VARCHAR(255), "eg Agree Objectives" VARCHAR(1) ) CREATE TABLE Grants ( grant_id INTEGER, organisation_id INTEGER, grant_amount DECIMAL(19,4), grant_start_date DATETIME, grant_end_date DATETIME, other_details VARCHAR(255) )
SELECT MIN(die_size__mm_2__) FROM table_26040604_1 WHERE sm_count = 2
What is the minimum die size for an SM count of exactly 2?
CREATE TABLE table_26040604_1 (die_size__mm_2__ INTEGER, sm_count VARCHAR)
SELECT MAX(grid) FROM table_name_59 WHERE team = "new zealand"
what is the highest grid for new zealand?
CREATE TABLE table_name_59 (grid INTEGER, team VARCHAR)
SELECT COUNT("Score") FROM table_29931 WHERE "Date" = 'January 12'
Name the number of score for january 12
CREATE TABLE table_29931 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )