answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
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
How many courses for each subject? Plot a bar chart, I want to display by the y-axis in descending.
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 Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) 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 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 rating__18_49_ FROM table_24689168_5 WHERE viewers__millions_ = "9.50"
What was the 18 to 49 rating when 9.50 million watched?
CREATE TABLE table_24689168_5 (rating__18_49_ VARCHAR, viewers__millions_ VARCHAR)
SELECT MAX(no_in_season) FROM table_27491610_2 WHERE no_in_series = 141
What number in season is number 141 in series?
CREATE TABLE table_27491610_2 (no_in_season INTEGER, no_in_series VARCHAR)
SELECT studio_s_ FROM table_name_71 WHERE director = "philip frank messina"
What studio has the director Philip Frank Messina?
CREATE TABLE table_name_71 ( studio_s_ VARCHAR, director VARCHAR )
SELECT episode FROM table_24689168_5 WHERE viewers__millions_ = "11.73"
what episode number had 11.73 million viewers?
CREATE TABLE table_24689168_5 (episode VARCHAR, viewers__millions_ VARCHAR)
SELECT formed_from FROM table_275023_1 WHERE province = "New Plymouth"
What province was New Plymouth formed from?
CREATE TABLE table_275023_1 (formed_from VARCHAR, province VARCHAR)
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 808) AND prescriptions.drug = 'albuterol 0.083% neb soln' AND STRFTIME('%y-%m', prescriptions.startdate) = '2105-08' ORDER BY prescriptions.startdate LIMIT 1
how much was albuterol 0.083% neb soln first prescribed to patient 808 in 08/2105?
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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE 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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) 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 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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text )
SELECT COUNT(episode) FROM table_24689168_5 WHERE viewers__millions_ = "11.47"
How many episodes had 11.47 million viewers?
CREATE TABLE table_24689168_5 (episode VARCHAR, viewers__millions_ VARCHAR)
SELECT reason FROM table_275023_1 WHERE province = "Otago"
Why was Otago formed?
CREATE TABLE table_275023_1 (reason VARCHAR, province VARCHAR)
SELECT record FROM table_name_78 WHERE year = "1997"
Name the record for 1997
CREATE TABLE table_name_78 ( record VARCHAR, year VARCHAR )
SELECT written_by FROM table_2468961_4 WHERE original_air_date = "April 29, 1994"
Who wrote the episode that originally aired April 29, 1994?
CREATE TABLE table_2468961_4 (written_by VARCHAR, original_air_date VARCHAR)
SELECT province FROM table_275023_1 WHERE formed_from = "New Munster"
What provinces were formed from New Munster?
CREATE TABLE table_275023_1 (province VARCHAR, formed_from VARCHAR)
SELECT "name" FROM table_204_292 WHERE "3 points\n(made/attempts)" IS NULL ORDER BY id DESC LIMIT 1
who is the last player on the list to not attempt a 3 point shot ?
CREATE TABLE table_204_292 ( id number, "no." number, "name" text, "class" number, "games" number, "minutes" number, "points" number, "2 points\n(made/attempts)" text, "2 points\n(%)" number, "3 points\n(made/attempts)" text, "3 points\n(%)" number, "free throws\n(made/attempts)" text, "free throws\n(%)" number, "rebounds offensive" number, "rebounds defensive" number, "rebounds total" number, "assists" number, "turnovers" number, "steals" number, "blocked shots" number, "personal fouls" number, "fouls drawn" number )
SELECT MAX(production_code) FROM table_2468961_4 WHERE original_air_date = "October 1, 1993"
What was the production code for the episode that debuted October 1, 1993?
CREATE TABLE table_2468961_4 (production_code INTEGER, original_air_date VARCHAR)
SELECT COUNT(formed_date) FROM table_275023_1 WHERE province = "Wellington"
How many provinces are named Wellington?
CREATE TABLE table_275023_1 (formed_date VARCHAR, province VARCHAR)
SELECT "Nation" FROM table_40860 WHERE "Record" = '5.06m(16ft7in)'
What nation has a Record of 5.06m(16ft7in)?
CREATE TABLE table_40860 ( "Record" text, "Athlete" text, "Nation" text, "Venue" text, "Date" text )
SELECT title FROM table_2468961_4 WHERE no_in_series = 56
What was the title of series number 56?
CREATE TABLE table_2468961_4 (title VARCHAR, no_in_series VARCHAR)
SELECT january FROM table_27537870_6 WHERE decision = "Lalime"
If the decision was by Lalime, when in January was it made?
CREATE TABLE table_27537870_6 (january VARCHAR, decision VARCHAR)
SELECT "End \u2013 UTC" FROM table_26984 WHERE "Comments" = 'First woman EVA'
When first woman eva is the comment what is the end -utc?
CREATE TABLE table_26984 ( "Spacecraft" text, "Spacewalker" text, "Start \u2013 UTC" text, "End \u2013 UTC" text, "Duration" text, "Comments" text )
SELECT title FROM table_2468961_4 WHERE written_by = "Julia Newton" AND no_in_series = 48
What was the title of the episode written by Julia Newton in series 48?
CREATE TABLE table_2468961_4 (title VARCHAR, written_by VARCHAR, no_in_series VARCHAR)
SELECT MAX(game) FROM table_27537870_6 WHERE january = 21
If the game was on January 21, which game was it?
CREATE TABLE table_27537870_6 (game INTEGER, january VARCHAR)
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name DESC
For those records from the products and each product's manufacturer, find name and code , and group by attribute name, and visualize them by a bar chart, and rank in desc by the bars.
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 callsign FROM table_24673888_1 WHERE station_type = "Relay" AND ch__number = "TV-2"
What is the callsign that has a station type of relay and a channel number of TV-2?
CREATE TABLE table_24673888_1 (callsign VARCHAR, station_type VARCHAR, ch__number VARCHAR)
SELECT decision FROM table_27537870_6 WHERE score = "5-3"
If the score is 5-3, who made the decision?
CREATE TABLE table_27537870_6 (decision VARCHAR, score VARCHAR)
SELECT SUM("Win %") FROM table_38332 WHERE "Coach" = 'john gartin' AND "Crew" = 'varsity 8+' AND "Year" = '2005'
What is the total number of win % when John Gartin is coach, the crew is varsity 8+, and the year is 2005?
CREATE TABLE table_38332 ( "Year" text, "Coach" text, "Crew" text, "Record" text, "Win %" real )
SELECT station_type FROM table_24673888_1 WHERE callsign = "DWZM-TV"
What is the station type of DWZM-TV?
CREATE TABLE table_24673888_1 (station_type VARCHAR, callsign VARCHAR)
SELECT record FROM table_27537870_6 WHERE opponent = "Philadelphia Flyers"
If the opponent was the Philadelphia flyers, what was the record?
CREATE TABLE table_27537870_6 (record VARCHAR, opponent VARCHAR)
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'lorazepam inj')
how much does a drug cost, lorazepam inj?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) 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 ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime 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 medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time )
SELECT power_kw FROM table_24673888_1 WHERE ch__number = "TV-12"
What is the power in kilowatts of TV-12?
CREATE TABLE table_24673888_1 (power_kw VARCHAR, ch__number VARCHAR)
SELECT opponent FROM table_27537870_6 WHERE record = "22-21-5"
If the record was 22-21-5, who was the opponent?
CREATE TABLE table_27537870_6 (opponent VARCHAR, record VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "8" AND procedures.long_title = "Other cystoscopy"
count the number of patients whose days of hospital stay is greater than 8 and procedure long title is other cystoscopy?
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 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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay 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 )
SELECT power_kw FROM table_24673888_1 WHERE location__transmitter_site_ = "Borongan"
What is the power in KW of the transmitter situated in Borongan?
CREATE TABLE table_24673888_1 (power_kw VARCHAR, location__transmitter_site_ VARCHAR)
SELECT location_attendance FROM table_27537870_6 WHERE opponent = "@ Boston Bruins"
If the opponent was @ Boston Bruins, what was the Location/Attendance?
CREATE TABLE table_27537870_6 (location_attendance VARCHAR, opponent VARCHAR)
SELECT "Kickoff Time" FROM table_41391 WHERE "Week" = '11'
What was the kickoff time for week 11's game?
CREATE TABLE table_41391 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Kickoff Time" text, "Attendance" text )
SELECT ch__number FROM table_24673888_1 WHERE branding = "PTV 4 Laoag"
What is the channel number that has a branding of PTV 4 Laoag?
CREATE TABLE table_24673888_1 (ch__number VARCHAR, branding VARCHAR)
SELECT MAX(february) FROM table_27539535_7 WHERE record = "17-29-7"
What day in February was the team 17-29-7?
CREATE TABLE table_27539535_7 (february INTEGER, record VARCHAR)
SELECT "Winning driver" FROM table_16780 WHERE "Circuit" = 'Goodwood'
Who was the winning driver for the goodwood circuit?
CREATE TABLE table_16780 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text )
SELECT power_kw FROM table_24673888_1 WHERE station_type = "Relay" AND callsign = "DXCL-TV"
What is the power in KW that has a station type of relay and a callsign of DXCL-TV?
CREATE TABLE table_24673888_1 (power_kw VARCHAR, station_type VARCHAR, callsign VARCHAR)
SELECT record FROM table_27539535_7 WHERE opponent = "Ottawa Senators"
What was the teams record when they played the ottawa senators?
CREATE TABLE table_27539535_7 (record VARCHAR, opponent VARCHAR)
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%arak%' ORDER BY Reputation DESC
tehran province of Iran Stackoverflow users.
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( 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 ReviewTaskStates ( 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 ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId 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 ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE VoteTypes ( Id number, Name 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 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 PostTags ( PostId number, TagId 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 PostTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount 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 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange 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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
SELECT MAX(no_in_series) FROM table_2468961_7 WHERE no_in_season = 15
When 15 is the number in season what is the highest number in series?
CREATE TABLE table_2468961_7 (no_in_series INTEGER, no_in_season VARCHAR)
SELECT record FROM table_27539535_7 WHERE february = 1
What was the team's rcord on february 1?
CREATE TABLE table_27539535_7 (record VARCHAR, february VARCHAR)
SELECT Reputation / 5 * 5, COUNT(CASE WHEN AnswerCount > 0 THEN 1 END) * 1.0 / COUNT(*) AS rate FROM Users, Posts WHERE Posts.PostTypeId = 1 AND OwnerUserId = Users.Id AND Reputation / 5 < '##maxReputation##' / 5 GROUP BY Reputation / 5 ORDER BY Reputation / 5
Chance of getting an answer by user rep.
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense 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 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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) 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 CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( 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 PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount 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 PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) 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 )
SELECT directed_by FROM table_2468961_7 WHERE no_in_series = 123
When 123 is the number in series who is the director?
CREATE TABLE table_2468961_7 (directed_by VARCHAR, no_in_series VARCHAR)
SELECT february FROM table_27539535_7 WHERE opponent = "Boston Bruins"
What day in February did the team play the boston bruins?
CREATE TABLE table_27539535_7 (february VARCHAR, opponent VARCHAR)
SELECT "Missile Type" FROM table_24900 WHERE "Code & location" = 'M-20 Harbor Drive'
What is every missile type with a code and location of M-20 Harbor Drive?
CREATE TABLE table_24900 ( "Code & location" text, "Missile Type" text, "Defense Area" text, "Dates" text, "Control Site condition/owner" text, "Launch Site condition/owner" text )
SELECT written_by FROM table_2468961_7 WHERE no_in_series = 120
When 120 is the number in series who is the writer?
CREATE TABLE table_2468961_7 (written_by VARCHAR, no_in_series VARCHAR)
SELECT season FROM table_27571406_1 WHERE team_name = "Pons Racing"
In what season did Pons Racing compete?
CREATE TABLE table_27571406_1 (season VARCHAR, team_name VARCHAR)
SELECT "Rank" FROM table_72556 WHERE "Common" = 'Galliate'
Where does the common of Galliate rank in population?
CREATE TABLE table_72556 ( "Rank" text, "Common" text, "Population" real, "Area (km 2 )" text, "Density (inhabitants/km 2 )" text, "Altitude (mslm)" real )
SELECT production_code FROM table_2468961_7 WHERE no_in_series = 137
When 137 is the number in series what is the production code?
CREATE TABLE table_2468961_7 (production_code VARCHAR, no_in_series VARCHAR)
SELECT f_laps FROM table_27571406_1 WHERE podiums = 8
What's the f/laps count for the team with 8 podiums?
CREATE TABLE table_27571406_1 (f_laps VARCHAR, podiums VARCHAR)
SELECT "Home team score" FROM table_53627 WHERE "Home team" = 'melbourne'
What did Melbourne score as the home team?
CREATE TABLE table_53627 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT COUNT(victor) FROM table_24706337_1 WHERE name_of_the_war = "War of 1730–1736 , first stage"
How many victors where there in the War of 1730–1736 , first stage?
CREATE TABLE table_24706337_1 (victor VARCHAR, name_of_the_war VARCHAR)
SELECT MIN(stage) FROM table_275506_1 WHERE yellow_jersey = "Ronan Pensec"
What is the lowest stage when the yellow jersey is Ronan Pensec?
CREATE TABLE table_275506_1 (stage INTEGER, yellow_jersey VARCHAR)
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL AND admissions.age BETWEEN 40 AND 49
how many current patients are of age 40s?
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title 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 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 ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) 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 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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number )
SELECT ottoman_sultan FROM table_24706337_1 WHERE treaty_at_the_end_of_the_war = "Treaty of Constantinople (1590)"
Who was the Ottoman Sultan where the treaty at the end of the war was the Treaty of Constantinople (1590)?
CREATE TABLE table_24706337_1 (ottoman_sultan VARCHAR, treaty_at_the_end_of_the_war VARCHAR)
SELECT yellow_jersey FROM table_275506_1 WHERE distance__km_ = "125"
What is every yellow jersey entry for the distance 125?
CREATE TABLE table_275506_1 (yellow_jersey VARCHAR, distance__km_ VARCHAR)
SELECT COUNT("Record") FROM table_23483 WHERE "Date" = 'February 22'
how many records were made on february 22
CREATE TABLE table_23483 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT name_of_the_war FROM table_24706337_1 WHERE ottoman_sultan = "Selim I"
What is the name of the war where the Ottoman sultan was Selim I?
CREATE TABLE table_24706337_1 (name_of_the_war VARCHAR, ottoman_sultan VARCHAR)
SELECT stage AS winner FROM table_275506_1 WHERE distance__km_ = "162.5"
Who is every stage winner at the distance of 162.5?
CREATE TABLE table_275506_1 (stage VARCHAR, distance__km_ VARCHAR)
SELECT "Region" FROM table_47378 WHERE "Location" = '49.7462°n 117.1419°w'
what is the region when the location is 49.7462 n 117.1419 w?
CREATE TABLE table_47378 ( "Rank" real, "Mountain Peak" text, "Region" text, "Mountain Range" text, "Location" text )
SELECT directed_by FROM table_2468961_6 WHERE no_in_series = 102
When 102 is the number in series who is the director?
CREATE TABLE table_2468961_6 (directed_by VARCHAR, no_in_series VARCHAR)
SELECT COUNT(start_of_stage) FROM table_275506_1 WHERE year = "2006"
How many entries for start of stage occur in the year 2006?
CREATE TABLE table_275506_1 (start_of_stage VARCHAR, year VARCHAR)
SELECT champion FROM table_25563779_4 WHERE third = "Bruno Bonifacio"
If the third name is Bruno Bonifacio, what is the champion?
CREATE TABLE table_25563779_4 ( champion VARCHAR, third VARCHAR )
SELECT written_by FROM table_2468961_8 WHERE directed_by = "Patrick Duffy" AND original_air_date = "November 7, 1997"
Name who wrote the episode directed by patrick duffy airing on november 7, 1997
CREATE TABLE table_2468961_8 (written_by VARCHAR, directed_by VARCHAR, original_air_date VARCHAR)
SELECT power__kw_ FROM table_27588823_2 WHERE callsign = "DWZF"
How much power does dwzf have?
CREATE TABLE table_27588823_2 (power__kw_ VARCHAR, callsign VARCHAR)
SELECT Location, COUNT(*) FROM Users WHERE Location LIKE '%portugal%' OR Location LIKE '%lisbon%' OR Location LIKE '%lisboa%' GROUP BY Location
number of users by tag.
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 ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) 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 ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name 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 PostTypes ( Id number, Name 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 ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId 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 FlagTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( 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 ReviewTaskStates ( 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 PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount 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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange 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 Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
SELECT MAX(last_year) FROM table_2472711_31 WHERE lowest = 23578
What is the last year total for the team with a lowest of 23578?
CREATE TABLE table_2472711_31 (last_year INTEGER, lowest VARCHAR)
SELECT branding FROM table_27588823_2 WHERE callsign = "DYPV"
What is the branding for callsign dypv?
CREATE TABLE table_27588823_2 (branding VARCHAR, callsign VARCHAR)
SELECT "Date" FROM table_32900 WHERE "Attendance" > '36,796'
When was the Browns' game that over 36,796 attended?
CREATE TABLE table_32900 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT COUNT(highest) FROM table_2472711_31 WHERE lowest = 16415
How many highest figures for the team with lowest of 16415?
CREATE TABLE table_2472711_31 (highest VARCHAR, lowest VARCHAR)
SELECT branding FROM table_27588823_2 WHERE location = "San Jose Del Monte"
What is the branding for the station located in san jose del monte?
CREATE TABLE table_27588823_2 (branding VARCHAR, location VARCHAR)
SELECT MAX("Bosniaks") FROM table_31641 WHERE "Census year" > '2002'
Tell me the highest bosniaks for year more than 2002
CREATE TABLE table_31641 ( "Census year" real, "Total" real, "Macedonians" real, "Albanians" real, "Turks" real, "Roma" real, "Vlachs" real, "Serbs" real, "Bosniaks" real, "Other" real )
SELECT team FROM table_2472711_31 WHERE up_down = "+ 3479"
Which team has an up/down of + 3479?
CREATE TABLE table_2472711_31 (team VARCHAR, up_down VARCHAR)
SELECT COUNT(callsign) FROM table_27588823_2 WHERE location = "Masinloc, Zambales"
How many call signs does the location masinloc, zambales have?
CREATE TABLE table_27588823_2 (callsign VARCHAR, location VARCHAR)
SELECT demographic.dob, demographic.insurance FROM demographic WHERE demographic.name = "Lawrence Wibbens"
show the date of birth and insurance type of lawrence wibbens.
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay 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 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 )
SELECT average FROM table_2472711_31 WHERE total = 243017
What is the average of the team where the total is 243017?
CREATE TABLE table_2472711_31 (average VARCHAR, total VARCHAR)
SELECT frequency FROM table_27588823_2 WHERE location = "Polangui, Albay"
What is the frequency of the station located in polangui, albay?
CREATE TABLE table_27588823_2 (frequency VARCHAR, location VARCHAR)
SELECT AVG(top_5) FROM table_name_72 WHERE tournament = "u.s. open" AND cuts_made > 10
What is the average Top-5, when Tournament is U.S. Open, and when Cuts Made is greater than 10?
CREATE TABLE table_name_72 ( top_5 INTEGER, tournament VARCHAR, cuts_made VARCHAR )
SELECT COUNT(episode) FROM table_24725951_1 WHERE celebrities = "Frank Skinner and Lee Mack"
How many episodes had celebrity guest stars Frank Skinner and Lee Mack?
CREATE TABLE table_24725951_1 (episode VARCHAR, celebrities VARCHAR)
SELECT points_classification FROM table_27573848_18 WHERE general_classification = "Fabian Cancellara" AND mountains_classification = "Mathias Frank"
If the mountains classification is Mathias Frank, and the General Classification is Fabian Cancellara, what is the Points classification?
CREATE TABLE table_27573848_18 (points_classification VARCHAR, general_classification VARCHAR, mountains_classification VARCHAR)
SELECT T1.name, MAX(T1.price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name
For each manufacturer name, what are the names and prices of their most expensive product?
CREATE TABLE manufacturers ( code number, name text, headquarter text, founder text, revenue number ) CREATE TABLE products ( code number, name text, price number, manufacturer number )
SELECT episode FROM table_24725951_1 WHERE directed_and_produced_by = "Karen Selway"
List episode directed and produced by Karen Selway?
CREATE TABLE table_24725951_1 (episode VARCHAR, directed_and_produced_by VARCHAR)
SELECT general_classification FROM table_27573848_18 WHERE points_classification = "Marco Marcato" AND stage < 5.0
If the stage is smaller than 5.0, and the points classification is by Marco Marcato, who is the General classification by?
CREATE TABLE table_27573848_18 (general_classification VARCHAR, points_classification VARCHAR, stage VARCHAR)
SELECT All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(Team_ID)
A bar chart shows the distribution of All_Home and the average of Team_ID , and group by attribute All_Home, rank by the y-axis from low to high.
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 ) CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text )
SELECT episode FROM table_24725951_1 WHERE celebrities = "Nick Hewer and Saira Khan"
Which episode had celebrities Nick Hewer and Saira Khan in them?
CREATE TABLE table_24725951_1 (episode VARCHAR, celebrities VARCHAR)
SELECT COUNT(general_classification) FROM table_27573848_18 WHERE stage = 5
How many different people had a General Classification on Stage 5?
CREATE TABLE table_27573848_18 (general_classification VARCHAR, stage VARCHAR)
SELECT DISTINCT flight_id FROM flight WHERE airline_code = 'CO'
only show CO flights
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) 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 compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code 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 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 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 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_fare ( flight_id int, fare_id int ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description 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 time_interval ( period text, begin_time int, end_time 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 airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE days ( days_code varchar, day_name varchar )
SELECT directed_and_produced_by FROM table_24725951_1 WHERE celebrities = "Nick Hewer and Saira Khan"
List the director and producer when Nick Hewer and Saira Khan were starring.
CREATE TABLE table_24725951_1 (directed_and_produced_by VARCHAR, celebrities VARCHAR)
SELECT COUNT(mountains_classification) FROM table_27573848_18 WHERE winner = "Robert Gesink"
How many times was Robert Gesink a winner?
CREATE TABLE table_27573848_18 (mountains_classification VARCHAR, winner VARCHAR)
SELECT "Competition" FROM table_11058 WHERE "Year" = '2008' AND "Surface" = 'carpet' AND "Date" = '31 jan'
Which competition has a Year of 2008, a Surface of carpet, and a Date of 31 jan?
CREATE TABLE table_11058 ( "Year" real, "Competition" text, "Date" text, "Surface" text, "Location" text, "Score" text, "Result" text )
SELECT directed_and_produced_by FROM table_24725951_1 WHERE celebrities = "Bill Turnbull and Louise Minchin"
List directors and producers when the celebrities involved were Bill Turnbull and Louise Minchin.
CREATE TABLE table_24725951_1 (directed_and_produced_by VARCHAR, celebrities VARCHAR)
SELECT mountains_classification FROM table_27573848_18 WHERE winner = "Rui Costa"
If the winner is Rui Costa, who made the mountains classification?
CREATE TABLE table_27573848_18 (mountains_classification VARCHAR, winner VARCHAR)
SELECT MIN(crowd) FROM table_name_18 WHERE home_team = "melbourne"
What was the smallest crowd that Melbourne played for at home?
CREATE TABLE table_name_18 ( crowd INTEGER, home_team VARCHAR )
SELECT torque FROM table_24729_2 WHERE co2 = "206g/km"
whe, co2 is 206g/km, what is the torque?
CREATE TABLE table_24729_2 (torque VARCHAR, co2 VARCHAR)
SELECT points FROM table_27603010_14 WHERE team__number1 = "Junior"
What was Team 1 Junior's points?
CREATE TABLE table_27603010_14 (points VARCHAR, team__number1 VARCHAR)
SELECT ".308 Winchester cartridge type" FROM table_68979 WHERE "100 m group (mm)" = '14' AND "300 m group ( MOA )" = '0.63'
Which of the .308 Winchester cartridge type has a 100 m group of 14 and also a 300 m group of 0.63?
CREATE TABLE table_68979 ( ".308 Winchester cartridge type" text, "100 m group (mm)" text, "100 m group ( MOA )" text, "300 m group (mm)" text, "300 m group ( MOA )" text )
SELECT power FROM table_24729_2 WHERE co2 = "192g/km"
when co2 is 192g/km, what is the power?
CREATE TABLE table_24729_2 (power VARCHAR, co2 VARCHAR)
SELECT 2 AS nd_leg FROM table_27603010_14 WHERE team__number1 = "Deportivo Pasto"
What was the 2nd leg score if the team 1 is Deportivo Pasto?
CREATE TABLE table_27603010_14 (team__number1 VARCHAR)
SELECT part_4 FROM table_1745843_7 WHERE part_3 = "borgen"
What's the part 4 for the verb whose part 3 is borgen?
CREATE TABLE table_1745843_7 ( part_4 VARCHAR, part_3 VARCHAR )