answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT "player" FROM table_203_611 ORDER BY "hr" DESC LIMIT 1
which player has the highest number of career home runs ?
CREATE TABLE table_203_611 ( id number, "player" text, "hr" number, "date reached 500 hr" text, "team" text, "seasons played" text )
SELECT incumbent FROM table_2668329_25 WHERE district = "Virginia 6"
Who is the incumbent in the Virginia 6 district?
CREATE TABLE table_2668329_25 (incumbent VARCHAR, district VARCHAR)
SELECT date FROM table_name_76 WHERE points < 80 AND home = "los angeles" AND visitor = "pittsburgh"
What Date has Points smaller than 80, Home of Los Angeles, and a Visitor of Pittsburgh?
CREATE TABLE table_name_76 (date VARCHAR, visitor VARCHAR, points VARCHAR, home VARCHAR)
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-29746')) AND lab.labname = 'direct bilirubin' AND lab.labresulttime = '2104-07-19 19:27:36') - (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-29746')) AND lab.labname = 'direct bilirubin' AND lab.labresulttime = '2104-04-05 07:18:00')
what are the changes in patient 016-29746's direct bilirubin values measured at 2104-07-19 19:27:36 compared to the value measured at 2104-04-05 07:18:00?
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) 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 medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime 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 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 )
SELECT party FROM table_2668329_11 WHERE incumbent = "Samuel Smith"
What is Samuel Smith's party?
CREATE TABLE table_2668329_11 (party VARCHAR, incumbent VARCHAR)
SELECT week_10_nov_2 FROM table_name_4 WHERE week_14_nov_30 = "penn state (11-1)"
Which Week 10 Nov 2 has a Week 14 Nov 30 of penn state (11-1)?
CREATE TABLE table_name_4 (week_10_nov_2 VARCHAR, week_14_nov_30 VARCHAR)
SELECT title FROM table_name_23 WHERE podcast_date = "september 25, 2005"
What is the title of the episode that aired on September 25, 2005?
CREATE TABLE table_name_23 ( title VARCHAR, podcast_date VARCHAR )
SELECT party FROM table_2668329_11 WHERE incumbent = "Peter Little"
what is Peter Little's party?
CREATE TABLE table_2668329_11 (party VARCHAR, incumbent VARCHAR)
SELECT week_7_oct_12 FROM table_name_15 WHERE week_11_nov_9 = "week 11 nov 9"
Which Week 7 Oct 12 has a Week 11 Nov 9 of week 11 nov 9?
CREATE TABLE table_name_15 (week_7_oct_12 VARCHAR, week_11_nov_9 VARCHAR)
SELECT COUNT("Parishes") FROM table_24798 WHERE "Province of 1936" = 'Beira Baixa Province'
Name the parishes for beira baixa province
CREATE TABLE table_24798 ( "District" text, "Municipalities" real, "Parishes" real, "Province of 1936" text, "Region" text )
SELECT result FROM table_2668329_11 WHERE incumbent = "Samuel Smith"
What was the result of Samuel Smith's race?
CREATE TABLE table_2668329_11 (result VARCHAR, incumbent VARCHAR)
SELECT week_7_oct_12 FROM table_name_79 WHERE week_9_oct_26 = "tulsa (7-0)"
Which Week 7 Oct 12 has a Week 9 Oct 26 of tulsa (7-0)?
CREATE TABLE table_name_79 (week_7_oct_12 VARCHAR, week_9_oct_26 VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.days_stay > "8"
count the number of patients whose admission type is newborn and days of hospital stay is greater than 8?
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 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 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 )
SELECT COUNT(result) FROM table_2668329_18 WHERE district = "North Carolina 9"
Name the result for north carolina 9
CREATE TABLE table_2668329_18 (result VARCHAR, district VARCHAR)
SELECT week_10_nov_2 FROM table_name_86 WHERE week_9_oct_26 = "lsu (5-2)"
Which Week 10 Nov 2 has a Week 9 Oct 26 of lsu (5-2)?
CREATE TABLE table_name_86 (week_10_nov_2 VARCHAR, week_9_oct_26 VARCHAR)
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS Place, Id AS "user_link", Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Thess%' OR Location LIKE '%Greece%' OR Location LIKE N'%Gr' OR (Location LIKE N'%Athens%' AND NOT Location LIKE N'%GA%') ORDER BY Reputation DESC LIMIT 1000
Greece 1000 with Row Number.
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 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 VoteTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) 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 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 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 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 ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTags ( PostId number, TagId number )
SELECT party FROM table_2668329_18 WHERE incumbent = "Hutchins G. Burton"
Name the party for hutchins g. burton
CREATE TABLE table_2668329_18 (party VARCHAR, incumbent VARCHAR)
SELECT week_14_nov_30 FROM table_name_1 WHERE week_6_oct_5 = "michigan state (5-1)"
Which Week 14 Nov 30 has a Week 6 Oct 5 of michigan state (5-1)?
CREATE TABLE table_name_1 (week_14_nov_30 VARCHAR, week_6_oct_5 VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND procedures.icd9_code = "8857"
how many patients whose admission location is trsf within this facility and procedure icd9 code is 8857?
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 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 COUNT(result) FROM table_2668329_18 WHERE candidates = "Thomas H. Hall (DR) 53.0% William Clarke (F) 47.0%"
Name the result for thomas h. hall (dr) 53.0% william clarke (f) 47.0%
CREATE TABLE table_2668329_18 (result VARCHAR, candidates VARCHAR)
SELECT week_13_nov_23 FROM table_name_73 WHERE week_6_oct_5 = "oklahoma state (5-0)"
Which Week 13 Nov 23 has a Week 6 Oct 5 of oklahoma state (5-0)?
CREATE TABLE table_name_73 (week_13_nov_23 VARCHAR, week_6_oct_5 VARCHAR)
SELECT HIRE_DATE, SALARY FROM employees ORDER BY HIRE_DATE DESC
Line chart, the X is the hire date of employees and the Y-axis is the corresponding salary, and I want to list X-axis from high to low order.
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) )
SELECT candidates FROM table_2668329_18 WHERE incumbent = "Felix Walker"
Name the candidates for felix walker
CREATE TABLE table_2668329_18 (candidates VARCHAR, incumbent VARCHAR)
SELECT displacement FROM table_name_16 WHERE torque = "n·m (lb·ft) @ 3000 rpm"
What was the displacement having a torque of n·m (lb·ft) @ 3000 rpm?
CREATE TABLE table_name_16 (displacement VARCHAR, torque VARCHAR)
SELECT "Transit Connections" FROM table_25302 WHERE "City/Neighborhood" = 'Columbia City, Seattle'
What's the transit connection in Columbia City, Seattle?
CREATE TABLE table_25302 ( "Station" text, "Line(s)" text, "City/Neighborhood" text, "Year opened" real, "Transit Connections" text, "Park and ride?" text )
SELECT candidates FROM table_2668336_24 WHERE incumbent = "John Pegram"
Who are the candidates when the incumbent is john pegram?
CREATE TABLE table_2668336_24 (candidates VARCHAR, incumbent VARCHAR)
SELECT engine FROM table_name_61 WHERE power = "48kw (65 ps) @ 5600 rpm"
Which engine had a 48kw (65 ps) @ 5600 rpm power?
CREATE TABLE table_name_61 (engine VARCHAR, power VARCHAR)
SELECT "Points" FROM table_34649 WHERE "Place" = '9'
What are the Points when the Place is 9?
CREATE TABLE table_34649 ( "Draw" real, "Singer" text, "Song" text, "Points" real, "Place" real )
SELECT candidates FROM table_2668336_24 WHERE district = "Virginia 12"
Who are the candidates for district virginia 12?
CREATE TABLE table_2668336_24 (candidates VARCHAR, district VARCHAR)
SELECT model FROM table_name_94 WHERE power = "66kw (90 ps) @ 6250 rpm"
Which model had a power of 66kw (90 ps) @ 6250 rpm?
CREATE TABLE table_name_94 (model VARCHAR, power VARCHAR)
SELECT MIN(bronze) FROM table_name_71 WHERE gold = 2 AND total > 6
What is the lowest number of bronze medals for nations with over 6 total and 2 golds?
CREATE TABLE table_name_71 ( bronze INTEGER, gold VARCHAR, total VARCHAR )
SELECT result FROM table_2668336_24 WHERE candidates = "Alexander Smyth (DR) 100%"
What is the result when the candidates are alexander smyth (dr) 100%
CREATE TABLE table_2668336_24 (result VARCHAR, candidates VARCHAR)
SELECT engine FROM table_name_78 WHERE displacement = "1,585 cc" AND model = "90i"
Which of the engines has a displacement of 1,585 cc, with a model number of 90i?
CREATE TABLE table_name_78 (engine VARCHAR, displacement VARCHAR, model VARCHAR)
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pleural effusion - right' GROUP BY patient.uniquepid HAVING MIN(diagnosis.diagnosistime) = diagnosis.diagnosistime) AS t1) AS t2 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'fentanyl citrate 0.05 mg/ml ij soln') AS t3 ON t2.uniquepid = t3.uniquepid WHERE t2.diagnosistime < t3.drugstarttime) AS t4 JOIN patient ON t4.uniquepid = patient.uniquepid
among patients who were prescribed fentanyl citrate 0.05 mg/ml ij soln after they had been diagnosed with pleural effusion - right show me the four year survival rate.
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime 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 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 ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
SELECT COUNT(incumbent) FROM table_2668336_24 WHERE candidates = "Charles F. Mercer (F) 100%"
How many times is the candidates charles f. mercer (f) 100%?
CREATE TABLE table_2668336_24 (incumbent VARCHAR, candidates VARCHAR)
SELECT opponent FROM table_name_25 WHERE venue = "memorial stadium"
Who was the opponent at memorial stadium?
CREATE TABLE table_name_25 (opponent VARCHAR, venue VARCHAR)
SELECT COUNT("Attendance") FROM table_17441 WHERE "Date" = 'May 20'
How many games were on May 20?
CREATE TABLE table_17441 ( "Date" text, "Winning Team" text, "Score" text, "Winning Pitcher" text, "Losing Pitcher" text, "Attendance" real, "Location" text )
SELECT COUNT(party) FROM table_2668347_14 WHERE incumbent = "John B. Yates"
how many times was the incumbent is john b. yates?
CREATE TABLE table_2668347_14 (party VARCHAR, incumbent VARCHAR)
SELECT height FROM table_name_43 WHERE player = "mike bibby"
Which Height has a Player of mike bibby?
CREATE TABLE table_name_43 (height VARCHAR, player VARCHAR)
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%Bengaluru%' OR UPPER(Location) LIKE '%Bengaluru%' OR Location LIKE '%Bengaluru%' OR LOWER(Location) LIKE '%Bangalore%' OR UPPER(Location) LIKE '%Bangalore%' OR Location LIKE '%Bangalore%' ORDER BY Reputation DESC LIMIT 10
top 10 users from Bengaluru India.
CREATE TABLE CloseReasonTypes ( 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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE 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 ReviewTaskResultTypes ( 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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTaskTypes ( 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 ) 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 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 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 PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostTags ( PostId number, TagId 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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number )
SELECT first_elected FROM table_2668347_14 WHERE candidates = "Thomas Lawyer (DR) 54.9% William Beekman (F) 45.1%"
when was the first elected when the candidates is thomas lawyer (dr) 54.9% william beekman (f) 45.1%?
CREATE TABLE table_2668347_14 (first_elected VARCHAR, candidates VARCHAR)
SELECT pos FROM table_name_11 WHERE first_round < 10
Which Pos has a First round smaller than 10?
CREATE TABLE table_name_11 (pos VARCHAR, first_round INTEGER)
SELECT date_to, COUNT(date_to) FROM Project_Staff
When do all the researcher role staff stop working? Bin the time into weekday interval and count them with a bar chart.
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 Tasks ( task_id INTEGER, project_id INTEGER, task_details VARCHAR(255), "eg Agree Objectives" VARCHAR(1) ) CREATE TABLE Staff_Roles ( role_code VARCHAR(10), role_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 Research_Outcomes ( outcome_code VARCHAR(10), outcome_description VARCHAR(255) ) CREATE TABLE Projects ( project_id INTEGER, organisation_id INTEGER, project_details 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 Grants ( grant_id INTEGER, organisation_id INTEGER, grant_amount DECIMAL(19,4), grant_start_date DATETIME, grant_end_date DATETIME, other_details VARCHAR(255) ) CREATE TABLE Document_Types ( document_type_code VARCHAR(10), document_description VARCHAR(255) ) CREATE TABLE Organisation_Types ( organisation_type VARCHAR(10), organisation_type_description VARCHAR(255) )
SELECT candidates FROM table_2668347_14 WHERE district = "New York 10"
who are the candidates for district new york 10?
CREATE TABLE table_2668347_14 (candidates VARCHAR, district VARCHAR)
SELECT COUNT(points) FROM table_name_96 WHERE losses < 5 AND draws = 0
How many points have a loss less than 5, and 0 for draws?
CREATE TABLE table_name_96 (points VARCHAR, losses VARCHAR, draws VARCHAR)
SELECT college_junior_club_team FROM table_name_31 WHERE position = "centre" AND pick__number = "22"
What College/junior/club team has a Position of centre, and pick is #22?
CREATE TABLE table_name_31 ( college_junior_club_team VARCHAR, position VARCHAR, pick__number VARCHAR )
SELECT COUNT(party) FROM table_2668347_14 WHERE candidates = "Thomas H. Hubbard (DR) 51.5% Simeon Ford (F) 48.4%"
how many times were the candidates thomas h. hubbard (dr) 51.5% simeon ford (f) 48.4%?
CREATE TABLE table_2668347_14 (party VARCHAR, candidates VARCHAR)
SELECT MIN(points) FROM table_name_23 WHERE league = "w-2 (w-league)" AND draws > 2
What is the lowest points that has w-2 (w-league) as the league, and draws greater than 2?
CREATE TABLE table_name_23 (points INTEGER, league VARCHAR, draws VARCHAR)
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-17669') AND NOT patient.unitdischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1) AND intakeoutput.cellpath LIKE '%intake%' ORDER BY intakeoutput.intakeoutputtime LIMIT 1
what did patient 016-17669 first have as an intake on the first icu visit?
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 microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime 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 treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
SELECT district FROM table_2668347_14 WHERE party = "Federalist" AND first_elected = "1814"
what is the district when the party is federalist and first elected is 1814?
CREATE TABLE table_2668347_14 (district VARCHAR, party VARCHAR, first_elected VARCHAR)
SELECT MIN(wins) FROM table_name_11 WHERE year < 1999 AND draws > 1 AND points > 17
What is the lowest wins that has a year prior to 1999, with draws greater than 1, and points greater than 17?
CREATE TABLE table_name_11 (wins INTEGER, points VARCHAR, year VARCHAR, draws VARCHAR)
SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE()))
select dateadd(dd, datediff(dd, 0, getdate()), 0).
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskResultTypes ( 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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId 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 PostTypes ( 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 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 ) 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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE 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 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 FlagTypes ( Id number, Name text, Description text )
SELECT candidates FROM table_2668347_17 WHERE district = "Pennsylvania 14"
Name the candidates for pennsylvania 14
CREATE TABLE table_2668347_17 (candidates VARCHAR, district VARCHAR)
SELECT SUM(losses) FROM table_name_52 WHERE year > 2001
How many losses have a year later than 2001?
CREATE TABLE table_name_52 (losses INTEGER, year INTEGER)
SELECT YEAR(p.CreationDate) AS "year", MONTH(p.CreationDate) AS "month", DAY(p.CreationDate) AS "day", COUNT(*) AS "questionsaskedtoday" FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = @tagName GROUP BY YEAR(p.CreationDate), MONTH(p.CreationDate), DAY(p.CreationDate) ORDER BY YEAR(p.CreationDate) DESC, MONTH(p.CreationDate) DESC, DAY(p.CreationDate) DESC
Questions per day for a specific tag. all time count of questions of a specific tag per day, with rollup
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 ReviewTaskResultTypes ( Id number, Name text, Description text ) 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostHistoryTypes ( Id number, Name 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 ) 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 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, 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 PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseReasonTypes ( 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 PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( 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 PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number )
SELECT incumbent FROM table_2668347_17 WHERE candidates = "Jacob Spangler (DR) 67.1% Jacob Hay (F) 32.9%"
Name the incumbent for jacob spangler (dr) 67.1% jacob hay (f) 32.9%
CREATE TABLE table_2668347_17 (incumbent VARCHAR, candidates VARCHAR)
SELECT county FROM table_name_80 WHERE name = "himco dump"
Which county includes Himco Dump?
CREATE TABLE table_name_80 (county VARCHAR, name 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, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight WHERE ((flight.to_airport = AIRPORT_SERVICE_1.airport_code AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE') OR (flight.to_airport = AIRPORT_SERVICE_2.airport_code AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'WASHINGTON')) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
which flights are between BOSTON and BALTIMORE WASHINGTON
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 ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name 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 days ( days_code varchar, day_name varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note 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 flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE compartment_class ( compartment varchar, class_type 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 dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) 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 )
SELECT MAX(first_elected) FROM table_2668347_17
Name the most first elected
CREATE TABLE table_2668347_17 (first_elected INTEGER)
SELECT MAX(points) FROM table_name_62 WHERE drawn = 0 AND games > 5
Drawn of 0, and a Games larger than 5 has what amount of highest points?
CREATE TABLE table_name_62 (points INTEGER, drawn VARCHAR, games VARCHAR)
SELECT COUNT("composer") FROM table_204_748 WHERE "nationality" = 'french'
tell me the number of french people on the list .
CREATE TABLE table_204_748 ( id number, "composer" text, "born" number, "died" number, "nationality" text, "notable works for piano" text, "remarks" text )
SELECT COUNT(candidates) FROM table_2668347_17 WHERE incumbent = "Samuel D. Ingham"
Name the number of candidates for samuel d. ingham
CREATE TABLE table_2668347_17 (candidates VARCHAR, incumbent VARCHAR)
SELECT MAX(drawn) FROM table_name_75 WHERE lost > 4
Lost larger than 4 is what highest drawn?
CREATE TABLE table_name_75 (drawn INTEGER, lost INTEGER)
SELECT "Launch complex" FROM table_59941 WHERE "Launcher" = 'soyuz (r)' AND "Flights" = '14 orbital'
Which complex used the Soyuz (r) launcher to facilitate 14 orbital flights?
CREATE TABLE table_59941 ( "Spaceport" text, "Launch complex" text, "Launcher" text, "Spacecraft" text, "Flights" text, "Years" text )
SELECT district FROM table_2668347_22 WHERE candidates = "William A. Burwell (DR)"
Which district did William A. Burwell (Dr) belong to?
CREATE TABLE table_2668347_22 (district VARCHAR, candidates VARCHAR)
SELECT SUM(games) FROM table_name_10 WHERE points_difference = "18 - 33" AND points < 4
Points difference of 18 - 33, and a Points smaller than 4 is the total of what sum of games?
CREATE TABLE table_name_10 (games INTEGER, points_difference VARCHAR, points VARCHAR)
SELECT "Character" FROM table_5919 WHERE "French voice actor" = 'marc saez' AND "German voice actor" = 'dirk fenselau'
Which character has a French voice actor of Marc Saez and a German voice actor of Dirk Fenselau?
CREATE TABLE table_5919 ( "Character" text, "French voice actor" text, "Italian voice actor" text, "German voice actor" text, "Spanish voice actor" text )
SELECT result FROM table_2668367_13 WHERE incumbent = "Thomas R. Gold"
What was the result in the district represented by Thomas R. Gold?
CREATE TABLE table_2668367_13 (result VARCHAR, incumbent VARCHAR)
SELECT MAX(first_elected) FROM table_name_73 WHERE party = "dem" AND district > 24 AND home_city_town = "berlin"
Which First elected is the highest one that has a Party of dem, and a District larger than 24, and a Home city/town of berlin?
CREATE TABLE table_name_73 (first_elected INTEGER, home_city_town VARCHAR, party VARCHAR, district VARCHAR)
SELECT emit__nm_ FROM table_name_86 WHERE mass__g_mol_ = "1078"
Which Emission (in nanometers) that has a molar mass of 1078 g/mol?
CREATE TABLE table_name_86 ( emit__nm_ VARCHAR, mass__g_mol_ VARCHAR )
SELECT incumbent FROM table_2668352_5 WHERE district = "Kentucky 2"
Who is every incumbent when Kentucky 2 is the district?
CREATE TABLE table_2668352_5 (incumbent VARCHAR, district VARCHAR)
SELECT record FROM table_name_45 WHERE visitor = "pittsburgh" AND date = "november 23"
What record has pittsburgh as the visitor, and November 23 as the date?
CREATE TABLE table_name_45 (record VARCHAR, visitor VARCHAR, date VARCHAR)
SELECT COUNT(effective_exhaust_velocity__m_s_) FROM table_15944_5 WHERE scenario = "Space shuttle vacuum"
What is the effective exhaust velocity in a Space Shuttle Vacuum?
CREATE TABLE table_15944_5 ( effective_exhaust_velocity__m_s_ VARCHAR, scenario VARCHAR )
SELECT first_elected FROM table_2668352_5 WHERE district = "Kentucky 6"
Who is first elected when Kentucky 6 is the district?
CREATE TABLE table_2668352_5 (first_elected VARCHAR, district VARCHAR)
SELECT record FROM table_name_13 WHERE points < 16 AND home = "detroit"
What record has points less than 16, and detroit as the home?
CREATE TABLE table_name_13 (record VARCHAR, points VARCHAR, home VARCHAR)
SELECT country FROM table_name_41 WHERE airport = "shanghai pudong international airport"
Which country contains the Shanghai Pudong International airport?
CREATE TABLE table_name_41 ( country VARCHAR, airport VARCHAR )
SELECT district FROM table_2668352_5 WHERE incumbent = "Joseph Desha"
What is every district for incumbent Joseph Desha?
CREATE TABLE table_2668352_5 (district VARCHAR, incumbent VARCHAR)
SELECT COUNT(points) FROM table_name_38 WHERE visitor = "pittsburgh" AND home = "philadelphia"
How many points have pittsburgh as the visitor, and philadelphia as the home?
CREATE TABLE table_name_38 (points VARCHAR, visitor VARCHAR, home VARCHAR)
SELECT "Date" FROM table_31560 WHERE "Winning constructor" = 'bugatti' AND "Winning driver" = 'stanislas czaykowski'
Tell me the date for bugatti fpr stanislas czaykowski
CREATE TABLE table_31560 ( "Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Winning constructor" text, "Report" text )
SELECT party FROM table_2668352_16 WHERE result = "Lost re-election Democratic-Republican hold"
Which party experienced a result of lost re-election democratic-republican hold?
CREATE TABLE table_2668352_16 (party VARCHAR, result VARCHAR)
SELECT points FROM table_name_30 WHERE home = "pittsburgh" AND date = "november 29"
What points have pittsburgh as the home, and November 29 as the date?
CREATE TABLE table_name_30 (points VARCHAR, home VARCHAR, date VARCHAR)
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'do not resusctate status') GROUP BY admissions.subject_id HAVING MIN(diagnoses_icd.charttime) = diagnoses_icd.charttime) AS t1 WHERE STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', t1.charttime) > 2 * 365) AS t2 JOIN patients ON t2.subject_id = patients.subject_id
what are the two year survival probability of a patient diagnosed with do not resusctate status?
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 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 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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title 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 )
SELECT COUNT(district) FROM table_2668352_16 WHERE incumbent = "John C. Calhoun"
How many districts have John C. Calhoun as the incumbent?
CREATE TABLE table_2668352_16 (district VARCHAR, incumbent VARCHAR)
SELECT attendance FROM table_name_66 WHERE date = "december 11, 1966"
What was the attendance at the game on December 11, 1966?
CREATE TABLE table_name_66 (attendance VARCHAR, date VARCHAR)
SELECT SUM("Release Date") FROM table_57026 WHERE "Media" = 'cd' AND "Country" = 'uk' AND "Music Label" = 'eg records'
What is the release date of the CD by EG Records in the UK?
CREATE TABLE table_57026 ( "Country" text, "Release Date" real, "Music Label" text, "Media" text, "Catalogue Number" text )
SELECT incumbent FROM table_2668367_7 WHERE district = "Kentucky 8"
Who was the incumbent in the Kentucky 8 district?
CREATE TABLE table_2668367_7 (incumbent VARCHAR, district VARCHAR)
SELECT MAX(week) FROM table_name_83 WHERE result = "l 14-3"
What was the latest week with a result of l 14-3?
CREATE TABLE table_name_83 (week INTEGER, result VARCHAR)
SELECT owner_descr FROM fires GROUP BY owner_descr ORDER BY COUNT(*) DESC LIMIT 1
On what type of land (public or private) do more wildfires occur?
CREATE TABLE fires ( fire_year number, discovery_date number, discovery_doy number, discovery_time text, stat_cause_code number, stat_cause_descr text, cont_date text, cont_doy text, cont_time text, fire_size number, fire_size_class text, latitude number, longitude number, owner_code number, owner_descr text, state text, county text, fips_code text, fips_name text )
SELECT result FROM table_2668367_7 WHERE district = "Kentucky 8"
What was the result in the election in the Kentucky 8 district?
CREATE TABLE table_2668367_7 (result VARCHAR, district VARCHAR)
SELECT COUNT(week) FROM table_name_14 WHERE date = "bye"
What was the total number of weeks with a date of bye?
CREATE TABLE table_name_14 (week VARCHAR, date VARCHAR)
SELECT COUNT("single") FROM table_204_365 WHERE "year" = 2010
how many singles were released in 2010 ?
CREATE TABLE table_204_365 ( id number, "year" number, "single" text, "chart positions\nusa billboard hot dance club play" number, "chart positions\npolish charts" number, "album" text )
SELECT result FROM table_2668367_7 WHERE district = "Kentucky 1"
What was the result in the election in the Kentucky 1 district?
CREATE TABLE table_2668367_7 (result VARCHAR, district VARCHAR)
SELECT opponent FROM table_name_20 WHERE result = "w 26-20"
Who was the opponent at the game with a result of W 26-20?
CREATE TABLE table_name_20 (opponent VARCHAR, result VARCHAR)
SELECT "Venue" FROM table_59567 WHERE "Against" > '13'
Which Venue has a Against larger than 13?
CREATE TABLE table_59567 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
SELECT district FROM table_2668374_13 WHERE incumbent = "John Smilie"
What district had an election with incumbent john smilie?
CREATE TABLE table_2668374_13 (district VARCHAR, incumbent VARCHAR)
SELECT attendance FROM table_name_89 WHERE week = 2
What was the attendance at the week 2 game?
CREATE TABLE table_name_89 (attendance VARCHAR, week VARCHAR)
SELECT MIN(goals_against) FROM table_name_38 WHERE played > 34
What is the lowest Goals Agains, when Played is greater than 34?
CREATE TABLE table_name_38 ( goals_against INTEGER, played INTEGER )
SELECT COUNT(district) FROM table_2668374_13 WHERE first_elected = "1808" AND incumbent = "George Smith"
How many districts first elected someone in 1808 and had george smith as the incumbent?
CREATE TABLE table_2668374_13 (district VARCHAR, first_elected VARCHAR, incumbent VARCHAR)
SELECT SUM(points) FROM table_name_96 WHERE team = "suzuki" AND year < 1981 AND wins < 0
Before 1981, how many Points did Team Suzuki have with less than 0 Wins?
CREATE TABLE table_name_96 (points INTEGER, wins VARCHAR, team VARCHAR, year VARCHAR)
SELECT location FROM table_name_83 WHERE score = "269 (–19)" AND tournament = "tallahassee open"
What is the location of the tallahassee open, with a Score of 269 ( 19)?
CREATE TABLE table_name_83 ( location VARCHAR, score VARCHAR, tournament VARCHAR )