instruction
stringlengths
0
1.06k
input
stringlengths
33
7.14k
response
stringlengths
2
4.44k
source
stringclasses
25 values
text
stringlengths
302
8.5k
Proportion of Questions with an Accepted Answer.
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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE VoteTypes ( 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 PostTypes ( Id number, Name text ) 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 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 CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) 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 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 PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTaskResultTypes ( 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 CloseReasonTypes ( Id number, Name text, Description text )
SELECT 1.0 * COUNT(CASE WHEN NOT AcceptedAnswerId IS NULL THEN 1 ELSE NULL END) / COUNT(*) FROM Posts WHERE PostTypeId = 1
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Proportion of Questions with an Accepted Answer. ### Input: 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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE VoteTypes ( 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 PostTypes ( Id number, Name text ) 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 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 CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) 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 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 PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTaskResultTypes ( 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 CloseReasonTypes ( Id number, Name text, Description text ) ### Response: SELECT 1.0 * COUNT(CASE WHEN NOT AcceptedAnswerId IS NULL THEN 1 ELSE NULL END) / COUNT(*) FROM Posts WHERE PostTypeId = 1
what is the number of medicare patients who had clofarabine intravenous infusion?
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicare" AND procedures.short_title = "IV infusion clofarabine"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of medicare patients who had clofarabine intravenous infusion? ### Input: 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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicare" AND procedures.short_title = "IV infusion clofarabine"
How many sets were played in the tournament that had 4R in 2011 and 2R in 2008?
CREATE TABLE table_name_60 ( Id VARCHAR )
SELECT 2009 FROM table_name_60 WHERE 2011 = "4r" AND 2008 = "2r"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many sets were played in the tournament that had 4R in 2011 and 2R in 2008? ### Input: CREATE TABLE table_name_60 ( Id VARCHAR ) ### Response: SELECT 2009 FROM table_name_60 WHERE 2011 = "4r" AND 2008 = "2r"
what's the 3rd day with finbeingh position being 16th
CREATE TABLE table_667 ( "Year" real, "Finish position" text, "1st day" text, "2nd day" text, "3rd day" text, "4th Day" text )
SELECT "3rd day" FROM table_667 WHERE "Finish position" = '16th'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the 3rd day with finbeingh position being 16th ### Input: CREATE TABLE table_667 ( "Year" real, "Finish position" text, "1st day" text, "2nd day" text, "3rd day" text, "4th Day" text ) ### Response: SELECT "3rd day" FROM table_667 WHERE "Finish position" = '16th'
What was the home team that played Vancouver on April 29?
CREATE TABLE table_name_62 ( home VARCHAR, visitor VARCHAR, date VARCHAR )
SELECT home FROM table_name_62 WHERE visitor = "vancouver" AND date = "april 29"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the home team that played Vancouver on April 29? ### Input: CREATE TABLE table_name_62 ( home VARCHAR, visitor VARCHAR, date VARCHAR ) ### Response: SELECT home FROM table_name_62 WHERE visitor = "vancouver" AND date = "april 29"
What Date has a label of alfa records?
CREATE TABLE table_70691 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
SELECT "Date" FROM table_70691 WHERE "Label" = 'alfa records'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Date has a label of alfa records? ### Input: CREATE TABLE table_70691 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) ### Response: SELECT "Date" FROM table_70691 WHERE "Label" = 'alfa records'
When did Pharaoh Seth's reign end?
CREATE TABLE table_11838 ( "Name" text, "Country" text, "Reign began" text, "Reign ended" text, "Length" text )
SELECT "Reign ended" FROM table_11838 WHERE "Name" = 'pharaoh seth'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When did Pharaoh Seth's reign end? ### Input: CREATE TABLE table_11838 ( "Name" text, "Country" text, "Reign began" text, "Reign ended" text, "Length" text ) ### Response: SELECT "Reign ended" FROM table_11838 WHERE "Name" = 'pharaoh seth'
Find the number of patients whose ethnicity is white - russian and drug route is ivpca?
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 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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.route = "IVPCA"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of patients whose ethnicity is white - russian and drug route is ivpca? ### Input: 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 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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.route = "IVPCA"
What are the number of the wines that have prices lower than 50 and have appelations in Monterey county?, and display by the x-axis in desc.
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT )
SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name ORDER BY Name DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the number of the wines that have prices lower than 50 and have appelations in Monterey county?, and display by the x-axis in desc. ### Input: CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) ### Response: SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name ORDER BY Name DESC
what would be the average yearly number of patients diagnosed with toxic myopathy since 3 years ago?
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name 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 admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )
SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'toxic myopathy') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY STRFTIME('%y', diagnoses_icd.charttime)) AS t1
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what would be the average yearly number of patients diagnosed with toxic myopathy since 3 years ago? ### Input: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name 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 admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ### Response: SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'toxic myopathy') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY STRFTIME('%y', diagnoses_icd.charttime)) AS t1
How many extra points did right halfback Roswell Wendell have?
CREATE TABLE table_75150 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
SELECT "Extra points" FROM table_75150 WHERE "Position" = 'right halfback' AND "Player" = 'roswell wendell'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many extra points did right halfback Roswell Wendell have? ### Input: CREATE TABLE table_75150 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real ) ### Response: SELECT "Extra points" FROM table_75150 WHERE "Position" = 'right halfback' AND "Player" = 'roswell wendell'
What was the Company or Product name where Entrepreneurs Geoff and Colette Bell requested 75,000?
CREATE TABLE table_name_25 ( company_or_product_name VARCHAR, money_requested__£_ VARCHAR, entrepreneur_s_ VARCHAR )
SELECT company_or_product_name FROM table_name_25 WHERE money_requested__£_ = "75,000" AND entrepreneur_s_ = "geoff and colette bell"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the Company or Product name where Entrepreneurs Geoff and Colette Bell requested 75,000? ### Input: CREATE TABLE table_name_25 ( company_or_product_name VARCHAR, money_requested__£_ VARCHAR, entrepreneur_s_ VARCHAR ) ### Response: SELECT company_or_product_name FROM table_name_25 WHERE money_requested__£_ = "75,000" AND entrepreneur_s_ = "geoff and colette bell"
what number of patients born before the year 2034 had lab test item id 51009?
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2034" AND lab.itemid = "51009"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what number of patients born before the year 2034 had lab test item id 51009? ### Input: 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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2034" AND lab.itemid = "51009"
What circuit has qualifying as the session?
CREATE TABLE table_name_77 ( circuit VARCHAR, session VARCHAR )
SELECT circuit FROM table_name_77 WHERE session = "qualifying"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What circuit has qualifying as the session? ### Input: CREATE TABLE table_name_77 ( circuit VARCHAR, session VARCHAR ) ### Response: SELECT circuit FROM table_name_77 WHERE session = "qualifying"
What are the fewest floors for the building that has a height of 116 meters?
CREATE TABLE table_name_42 ( floors INTEGER, height__m_ VARCHAR )
SELECT MIN(floors) FROM table_name_42 WHERE height__m_ = 116
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the fewest floors for the building that has a height of 116 meters? ### Input: CREATE TABLE table_name_42 ( floors INTEGER, height__m_ VARCHAR ) ### Response: SELECT MIN(floors) FROM table_name_42 WHERE height__m_ = 116
what is the one year survival rate of patients suffering from acute respiratory failure - due to pulmonary infiltrates who were prescribed cefazolin 2 gm in ns 100 ml ivpb (repackage)?
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime 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 treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime 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 ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 1 * 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 = 'acute respiratory failure - due to pulmonary infiltrates' 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 = 'cefazolin 2 gm in ns 100 ml ivpb (repackage)') AS t3 ON t2.uniquepid = t3.uniquepid WHERE t2.diagnosistime < t3.drugstarttime) AS t4 JOIN patient ON t4.uniquepid = patient.uniquepid
eicu
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the one year survival rate of patients suffering from acute respiratory failure - due to pulmonary infiltrates who were prescribed cefazolin 2 gm in ns 100 ml ivpb (repackage)? ### Input: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime 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 treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime 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 ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) ### Response: SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 1 * 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 = 'acute respiratory failure - due to pulmonary infiltrates' 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 = 'cefazolin 2 gm in ns 100 ml ivpb (repackage)') AS t3 ON t2.uniquepid = t3.uniquepid WHERE t2.diagnosistime < t3.drugstarttime) AS t4 JOIN patient ON t4.uniquepid = patient.uniquepid
How many hispanic, latino, or puerto rican patients are on drug named sucralfate?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE 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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.drug = "Sucralfate"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many hispanic, latino, or puerto rican patients are on drug named sucralfate? ### Input: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE 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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.drug = "Sucralfate"
What player has +3 to par and score of 75-72=147?
CREATE TABLE table_name_23 ( player VARCHAR, to_par VARCHAR, score VARCHAR )
SELECT player FROM table_name_23 WHERE to_par = "+3" AND score = 75 - 72 = 147
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What player has +3 to par and score of 75-72=147? ### Input: CREATE TABLE table_name_23 ( player VARCHAR, to_par VARCHAR, score VARCHAR ) ### Response: SELECT player FROM table_name_23 WHERE to_par = "+3" AND score = 75 - 72 = 147
What's the score for the t10 player from zimbabwe?
CREATE TABLE table_name_19 ( score VARCHAR, place VARCHAR, country VARCHAR )
SELECT score FROM table_name_19 WHERE place = "t10" AND country = "zimbabwe"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the score for the t10 player from zimbabwe? ### Input: CREATE TABLE table_name_19 ( score VARCHAR, place VARCHAR, country VARCHAR ) ### Response: SELECT score FROM table_name_19 WHERE place = "t10" AND country = "zimbabwe"
What are the names and ids of customers whose address contains TN Show bar chart, and rank in asc by the y-axis.
CREATE TABLE Staff_Department_Assignments ( staff_id INTEGER, department_id INTEGER, date_assigned_from DATETIME, job_title_code VARCHAR(10), date_assigned_to DATETIME ) CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_status_code VARCHAR(10), order_date DATETIME ) CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER ) CREATE TABLE Product_Suppliers ( product_id INTEGER, supplier_id INTEGER, date_supplied_from DATETIME, date_supplied_to DATETIME, total_amount_purchased VARCHAR(80), total_value_purchased DECIMAL(19,4) ) CREATE TABLE Supplier_Addresses ( supplier_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Department_Store_Chain ( dept_store_chain_id INTEGER, dept_store_chain_name VARCHAR(80) ) CREATE TABLE Suppliers ( supplier_id INTEGER, supplier_name VARCHAR(80), supplier_phone VARCHAR(80) ) CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(10), product_name VARCHAR(80), product_price DECIMAL(19,4) ) CREATE TABLE Addresses ( address_id INTEGER, address_details VARCHAR(255) ) CREATE TABLE Staff ( staff_id INTEGER, staff_gender VARCHAR(1), staff_name VARCHAR(80) ) CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Departments ( department_id INTEGER, dept_store_id INTEGER, department_name VARCHAR(80) ) CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(10), customer_code VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255), customer_phone VARCHAR(80), customer_email VARCHAR(80) ) CREATE TABLE Department_Stores ( dept_store_id INTEGER, dept_store_chain_id INTEGER, store_name VARCHAR(80), store_address VARCHAR(255), store_phone VARCHAR(80), store_email VARCHAR(80) )
SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" ORDER BY customer_id
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the names and ids of customers whose address contains TN Show bar chart, and rank in asc by the y-axis. ### Input: CREATE TABLE Staff_Department_Assignments ( staff_id INTEGER, department_id INTEGER, date_assigned_from DATETIME, job_title_code VARCHAR(10), date_assigned_to DATETIME ) CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_status_code VARCHAR(10), order_date DATETIME ) CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER ) CREATE TABLE Product_Suppliers ( product_id INTEGER, supplier_id INTEGER, date_supplied_from DATETIME, date_supplied_to DATETIME, total_amount_purchased VARCHAR(80), total_value_purchased DECIMAL(19,4) ) CREATE TABLE Supplier_Addresses ( supplier_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Department_Store_Chain ( dept_store_chain_id INTEGER, dept_store_chain_name VARCHAR(80) ) CREATE TABLE Suppliers ( supplier_id INTEGER, supplier_name VARCHAR(80), supplier_phone VARCHAR(80) ) CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(10), product_name VARCHAR(80), product_price DECIMAL(19,4) ) CREATE TABLE Addresses ( address_id INTEGER, address_details VARCHAR(255) ) CREATE TABLE Staff ( staff_id INTEGER, staff_gender VARCHAR(1), staff_name VARCHAR(80) ) CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Departments ( department_id INTEGER, dept_store_id INTEGER, department_name VARCHAR(80) ) CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(10), customer_code VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255), customer_phone VARCHAR(80), customer_email VARCHAR(80) ) CREATE TABLE Department_Stores ( dept_store_id INTEGER, dept_store_chain_id INTEGER, store_name VARCHAR(80), store_address VARCHAR(255), store_phone VARCHAR(80), store_email VARCHAR(80) ) ### Response: SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" ORDER BY customer_id
What is Opponent, when Location/Attendance is 'Mellon Arena - 17,132'?
CREATE TABLE table_46904 ( "Game" real, "Date" real, "Opponent" text, "Score" text, "Decision" text, "Location/Attendance" text, "Record" text )
SELECT "Opponent" FROM table_46904 WHERE "Location/Attendance" = 'mellon arena - 17,132'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Opponent, when Location/Attendance is 'Mellon Arena - 17,132'? ### Input: CREATE TABLE table_46904 ( "Game" real, "Date" real, "Opponent" text, "Score" text, "Decision" text, "Location/Attendance" text, "Record" text ) ### Response: SELECT "Opponent" FROM table_46904 WHERE "Location/Attendance" = 'mellon arena - 17,132'
Show the players and years played for players from team 'Columbus Crew'.
CREATE TABLE player ( player_id number, player text, years_played text, total_wl text, singles_wl text, doubles_wl text, team number ) CREATE TABLE team ( team_id number, name text ) CREATE TABLE match_season ( season number, player text, position text, country number, team number, draft_pick_number number, draft_class text, college text ) CREATE TABLE country ( country_id number, country_name text, capital text, official_native_language text )
SELECT T1.player, T1.years_played FROM player AS T1 JOIN team AS T2 ON T1.team = T2.team_id WHERE T2.name = "Columbus Crew"
spider
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the players and years played for players from team 'Columbus Crew'. ### Input: CREATE TABLE player ( player_id number, player text, years_played text, total_wl text, singles_wl text, doubles_wl text, team number ) CREATE TABLE team ( team_id number, name text ) CREATE TABLE match_season ( season number, player text, position text, country number, team number, draft_pick_number number, draft_class text, college text ) CREATE TABLE country ( country_id number, country_name text, capital text, official_native_language text ) ### Response: SELECT T1.player, T1.years_played FROM player AS T1 JOIN team AS T2 ON T1.team = T2.team_id WHERE T2.name = "Columbus Crew"
Which district had first elected earlier than 2006 for representation of Broken Arrow, Tulsa?
CREATE TABLE table_name_7 ( district VARCHAR, first_elected VARCHAR, towns_represented VARCHAR )
SELECT district FROM table_name_7 WHERE first_elected < 2006 AND towns_represented = "broken arrow, tulsa"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which district had first elected earlier than 2006 for representation of Broken Arrow, Tulsa? ### Input: CREATE TABLE table_name_7 ( district VARCHAR, first_elected VARCHAR, towns_represented VARCHAR ) ### Response: SELECT district FROM table_name_7 WHERE first_elected < 2006 AND towns_represented = "broken arrow, tulsa"
A bar chart for finding the number of the category descriptions of the products whose descriptions include letter 't', and could you rank x axis from low to high order?
CREATE TABLE Ref_Colors ( color_code VARCHAR(15), color_description VARCHAR(80) ) CREATE TABLE Ref_Characteristic_Types ( characteristic_type_code VARCHAR(15), characteristic_type_description VARCHAR(80) ) CREATE TABLE Product_Characteristics ( product_id INTEGER, characteristic_id INTEGER, product_characteristic_value VARCHAR(50) ) CREATE TABLE Characteristics ( characteristic_id INTEGER, characteristic_type_code VARCHAR(15), characteristic_data_type VARCHAR(10), characteristic_name VARCHAR(80), other_characteristic_details VARCHAR(255) ) CREATE TABLE Products ( product_id INTEGER, color_code VARCHAR(15), product_category_code VARCHAR(15), product_name VARCHAR(80), typical_buying_price VARCHAR(20), typical_selling_price VARCHAR(20), product_description VARCHAR(255), other_product_details VARCHAR(255) ) CREATE TABLE Ref_Product_Categories ( product_category_code VARCHAR(15), product_category_description VARCHAR(80), unit_of_measure VARCHAR(20) )
SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY product_category_description
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for finding the number of the category descriptions of the products whose descriptions include letter 't', and could you rank x axis from low to high order? ### Input: CREATE TABLE Ref_Colors ( color_code VARCHAR(15), color_description VARCHAR(80) ) CREATE TABLE Ref_Characteristic_Types ( characteristic_type_code VARCHAR(15), characteristic_type_description VARCHAR(80) ) CREATE TABLE Product_Characteristics ( product_id INTEGER, characteristic_id INTEGER, product_characteristic_value VARCHAR(50) ) CREATE TABLE Characteristics ( characteristic_id INTEGER, characteristic_type_code VARCHAR(15), characteristic_data_type VARCHAR(10), characteristic_name VARCHAR(80), other_characteristic_details VARCHAR(255) ) CREATE TABLE Products ( product_id INTEGER, color_code VARCHAR(15), product_category_code VARCHAR(15), product_name VARCHAR(80), typical_buying_price VARCHAR(20), typical_selling_price VARCHAR(20), product_description VARCHAR(255), other_product_details VARCHAR(255) ) CREATE TABLE Ref_Product_Categories ( product_category_code VARCHAR(15), product_category_description VARCHAR(80), unit_of_measure VARCHAR(20) ) ### Response: SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY product_category_description
count the number of patients who have had systemic antibiotics - quinolone performed since 3 years ago.
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime 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 lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime 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 diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time )
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'systemic antibiotics - quinolone' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-3 year'))
eicu
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients who have had systemic antibiotics - quinolone performed since 3 years ago. ### Input: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime 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 lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime 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 diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) ### Response: SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'systemic antibiotics - quinolone' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-3 year'))
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a line chart about the change of employee_id over hire_date .
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) )
SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a line chart about the change of employee_id over hire_date . ### Input: CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) ) ### Response: SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
Which player has a subtotal of more than 3 and more than 8 in round 1?
CREATE TABLE table_79006 ( "Player" text, "Team" text, "Round 1" real, "Round 2" text, "Subtotal" real, "Finals" text, "Total" real )
SELECT "Player" FROM table_79006 WHERE "Subtotal" > '3' AND "Round 1" > '8'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which player has a subtotal of more than 3 and more than 8 in round 1? ### Input: CREATE TABLE table_79006 ( "Player" text, "Team" text, "Round 1" real, "Round 2" text, "Subtotal" real, "Finals" text, "Total" real ) ### Response: SELECT "Player" FROM table_79006 WHERE "Subtotal" > '3' AND "Round 1" > '8'
Which Socialist candidate ran against American Labor candidate Caroline O'Day?
CREATE TABLE table_name_65 ( socialist_ticket VARCHAR, american_labor_ticket VARCHAR )
SELECT socialist_ticket FROM table_name_65 WHERE american_labor_ticket = "caroline o'day"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Socialist candidate ran against American Labor candidate Caroline O'Day? ### Input: CREATE TABLE table_name_65 ( socialist_ticket VARCHAR, american_labor_ticket VARCHAR ) ### Response: SELECT socialist_ticket FROM table_name_65 WHERE american_labor_ticket = "caroline o'day"
Which film has a role named Taylor?
CREATE TABLE table_6390 ( "Year" real, "Film" text, "Role" text, "Language" text, "Notes" text )
SELECT "Film" FROM table_6390 WHERE "Role" = 'taylor'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which film has a role named Taylor? ### Input: CREATE TABLE table_6390 ( "Year" real, "Film" text, "Role" text, "Language" text, "Notes" text ) ### Response: SELECT "Film" FROM table_6390 WHERE "Role" = 'taylor'
Who held pole position at the race won by Gilles Villeneuve, with the fastest lap held by Gilles Villeneuve, driving a Ferrari?
CREATE TABLE table_56348 ( "Race" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Constructor" text, "Report" text )
SELECT "Pole Position" FROM table_56348 WHERE "Fastest Lap" = 'gilles villeneuve' AND "Constructor" = 'ferrari' AND "Race Winner" = 'gilles villeneuve'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who held pole position at the race won by Gilles Villeneuve, with the fastest lap held by Gilles Villeneuve, driving a Ferrari? ### Input: CREATE TABLE table_56348 ( "Race" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Constructor" text, "Report" text ) ### Response: SELECT "Pole Position" FROM table_56348 WHERE "Fastest Lap" = 'gilles villeneuve' AND "Constructor" = 'ferrari' AND "Race Winner" = 'gilles villeneuve'
What are the types and nationalities of every ship?
CREATE TABLE mission ( mission_id number, ship_id number, code text, launched_year number, location text, speed_knots number, fate text ) CREATE TABLE ship ( ship_id number, name text, type text, nationality text, tonnage number )
SELECT type, nationality FROM ship
spider
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the types and nationalities of every ship? ### Input: CREATE TABLE mission ( mission_id number, ship_id number, code text, launched_year number, location text, speed_knots number, fate text ) CREATE TABLE ship ( ship_id number, name text, type text, nationality text, tonnage number ) ### Response: SELECT type, nationality FROM ship
what is the name of the episode whose premiere was in march 2, 1997?
CREATE TABLE table_24872 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
SELECT "Title" FROM table_24872 WHERE "Original air date" = 'March 2, 1997'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the name of the episode whose premiere was in march 2, 1997? ### Input: CREATE TABLE table_24872 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text ) ### Response: SELECT "Title" FROM table_24872 WHERE "Original air date" = 'March 2, 1997'
Return the dates of birth for entrepreneurs who have either the investor Simon Woodroffe or Peter Jones, and count them by a bar chart, and rank by the how many date of birth from high to low.
CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text )
SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" ORDER BY COUNT(Date_of_Birth) DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return the dates of birth for entrepreneurs who have either the investor Simon Woodroffe or Peter Jones, and count them by a bar chart, and rank by the how many date of birth from high to low. ### Input: CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) ### Response: SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" ORDER BY COUNT(Date_of_Birth) DESC
Which play is from Ireland?
CREATE TABLE table_62458 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
SELECT "Player" FROM table_62458 WHERE "Country" = 'ireland'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which play is from Ireland? ### Input: CREATE TABLE table_62458 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) ### Response: SELECT "Player" FROM table_62458 WHERE "Country" = 'ireland'
What is the state of the team who plays in Mumbai?
CREATE TABLE table_66769 ( "Team" text, "City" text, "State" text, "Home venue" text, "Capacity" real )
SELECT "State" FROM table_66769 WHERE "Team" = 'mumbai'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the state of the team who plays in Mumbai? ### Input: CREATE TABLE table_66769 ( "Team" text, "City" text, "State" text, "Home venue" text, "Capacity" real ) ### Response: SELECT "State" FROM table_66769 WHERE "Team" = 'mumbai'
What is the size of the crowd for the game with Footscray as the home team?
CREATE TABLE table_32861 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT AVG("Crowd") FROM table_32861 WHERE "Home team" = 'footscray'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the size of the crowd for the game with Footscray as the home team? ### Input: CREATE TABLE table_32861 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) ### Response: SELECT AVG("Crowd") FROM table_32861 WHERE "Home team" = 'footscray'
Ashley Grimes had what to club?
CREATE TABLE table_49705 ( "Exit Date" text, "Pos." text, "Player" text, "To club" text, "Transfer fee" text )
SELECT "To club" FROM table_49705 WHERE "Player" = 'ashley grimes'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Ashley Grimes had what to club? ### Input: CREATE TABLE table_49705 ( "Exit Date" text, "Pos." text, "Player" text, "To club" text, "Transfer fee" text ) ### Response: SELECT "To club" FROM table_49705 WHERE "Player" = 'ashley grimes'
What is the lowest bronze medal count for Italy with fewer than 6 gold medals and greater than 10 total medals?
CREATE TABLE table_name_14 ( bronze INTEGER, total VARCHAR, gold VARCHAR, nation VARCHAR )
SELECT MIN(bronze) FROM table_name_14 WHERE gold < 6 AND nation = "italy" AND total > 10
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest bronze medal count for Italy with fewer than 6 gold medals and greater than 10 total medals? ### Input: CREATE TABLE table_name_14 ( bronze INTEGER, total VARCHAR, gold VARCHAR, nation VARCHAR ) ### Response: SELECT MIN(bronze) FROM table_name_14 WHERE gold < 6 AND nation = "italy" AND total > 10
What was the result of the game that was played on 29,30 31 May 1902?
CREATE TABLE table_42819 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text )
SELECT "Result" FROM table_42819 WHERE "Date" = '29,30–31 may 1902'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the result of the game that was played on 29,30 31 May 1902? ### Input: CREATE TABLE table_42819 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text ) ### Response: SELECT "Result" FROM table_42819 WHERE "Date" = '29,30–31 may 1902'
All CommunityWiky posts by users that aren't closed.
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) 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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange 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 PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE 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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description 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 VoteTypes ( Id number, Name text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE 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 ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text )
SELECT PostTypes.Name, Posts.Id AS "post_link", Posts.Score AS Score, Users.DisplayName, Posts.CreationDate FROM Posts INNER JOIN Users ON Posts.OwnerUserId = Users.Id INNER JOIN PostTypes ON Posts.PostTypeId = PostTypes.Id LEFT JOIN Posts AS ParentPosts ON Posts.ParentId = ParentPosts.Id WHERE Posts.PostTypeId IN (1, 2) AND Posts.ClosedDate IS NULL AND ParentPosts.ClosedDate IS NULL AND NOT (Posts.CommunityOwnedDate IS NULL) AND (ParentPosts.CommunityOwnedDate IS NULL) ORDER BY Users.DisplayName, Posts.CreationDate
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: All CommunityWiky posts by users that aren't closed. ### Input: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) 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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange 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 PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE 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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description 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 VoteTypes ( Id number, Name text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE 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 ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) ### Response: SELECT PostTypes.Name, Posts.Id AS "post_link", Posts.Score AS Score, Users.DisplayName, Posts.CreationDate FROM Posts INNER JOIN Users ON Posts.OwnerUserId = Users.Id INNER JOIN PostTypes ON Posts.PostTypeId = PostTypes.Id LEFT JOIN Posts AS ParentPosts ON Posts.ParentId = ParentPosts.Id WHERE Posts.PostTypeId IN (1, 2) AND Posts.ClosedDate IS NULL AND ParentPosts.ClosedDate IS NULL AND NOT (Posts.CommunityOwnedDate IS NULL) AND (ParentPosts.CommunityOwnedDate IS NULL) ORDER BY Users.DisplayName, Posts.CreationDate
Which team has 48 rebounds?
CREATE TABLE table_36063 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Rebounds" real )
SELECT "Team" FROM table_36063 WHERE "Rebounds" = '48'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which team has 48 rebounds? ### Input: CREATE TABLE table_36063 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Rebounds" real ) ### Response: SELECT "Team" FROM table_36063 WHERE "Rebounds" = '48'
How many bronzes for nations ranked above 7, under 3 golds, and under 10 total medals?
CREATE TABLE table_56104 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT COUNT("Bronze") FROM table_56104 WHERE "Rank" < '7' AND "Gold" < '3' AND "Total" < '10'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many bronzes for nations ranked above 7, under 3 golds, and under 10 total medals? ### Input: CREATE TABLE table_56104 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) ### Response: SELECT COUNT("Bronze") FROM table_56104 WHERE "Rank" < '7' AND "Gold" < '3' AND "Total" < '10'
What percentage of Slovenes lived in the village of Roach in 1951?
CREATE TABLE table_name_31 ( percent_of_slovenes_1951 VARCHAR, village__german_ VARCHAR )
SELECT percent_of_slovenes_1951 FROM table_name_31 WHERE village__german_ = "roach"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What percentage of Slovenes lived in the village of Roach in 1951? ### Input: CREATE TABLE table_name_31 ( percent_of_slovenes_1951 VARCHAR, village__german_ VARCHAR ) ### Response: SELECT percent_of_slovenes_1951 FROM table_name_31 WHERE village__german_ = "roach"
How many values for constituency for the vote result of 162?
CREATE TABLE table_73869 ( "Constituency" text, "Candidate" text, "Affiliation" text, "Result - votes" real, "Result - %" text, "Loss/gain" text )
SELECT COUNT("Constituency") FROM table_73869 WHERE "Result - votes" = '162'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many values for constituency for the vote result of 162? ### Input: CREATE TABLE table_73869 ( "Constituency" text, "Candidate" text, "Affiliation" text, "Result - votes" real, "Result - %" text, "Loss/gain" text ) ### Response: SELECT COUNT("Constituency") FROM table_73869 WHERE "Result - votes" = '162'
what is the overall number of chosen ideas where the person is scott parker
CREATE TABLE table_2840500_3 ( pick VARCHAR, player VARCHAR )
SELECT COUNT(pick) FROM table_2840500_3 WHERE player = "Scott Parker"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the overall number of chosen ideas where the person is scott parker ### Input: CREATE TABLE table_2840500_3 ( pick VARCHAR, player VARCHAR ) ### Response: SELECT COUNT(pick) FROM table_2840500_3 WHERE player = "Scott Parker"
What is the club when the chairman is roger lambrecht?
CREATE TABLE table_29447 ( "Club" text, "Chairman" text, "Current manager" text, "Team captain" text, "Kitmaker" text, "Shirt sponsor" text )
SELECT "Club" FROM table_29447 WHERE "Chairman" = 'Roger Lambrecht'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the club when the chairman is roger lambrecht? ### Input: CREATE TABLE table_29447 ( "Club" text, "Chairman" text, "Current manager" text, "Team captain" text, "Kitmaker" text, "Shirt sponsor" text ) ### Response: SELECT "Club" FROM table_29447 WHERE "Chairman" = 'Roger Lambrecht'
Name the total number of pommel horses for vault of 9.475 and rank more than 16
CREATE TABLE table_10188 ( "Rank" real, "Gymnast" text, "Floor Exercise" real, "Pommel Horse" real, "Rings" real, "Vault" real, "Parallel Bars" real, "Horizontal Bar" real, "Total" real )
SELECT COUNT("Pommel Horse") FROM table_10188 WHERE "Rank" > '16' AND "Vault" = '9.475'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the total number of pommel horses for vault of 9.475 and rank more than 16 ### Input: CREATE TABLE table_10188 ( "Rank" real, "Gymnast" text, "Floor Exercise" real, "Pommel Horse" real, "Rings" real, "Vault" real, "Parallel Bars" real, "Horizontal Bar" real, "Total" real ) ### Response: SELECT COUNT("Pommel Horse") FROM table_10188 WHERE "Rank" > '16' AND "Vault" = '9.475'
What is Mark Henry's brand?
CREATE TABLE table_65340 ( "Draw" real, "Entrant" text, "Brand" text, "Order" text, "Eliminated by" text, "Time" text )
SELECT "Brand" FROM table_65340 WHERE "Entrant" = 'mark henry'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Mark Henry's brand? ### Input: CREATE TABLE table_65340 ( "Draw" real, "Entrant" text, "Brand" text, "Order" text, "Eliminated by" text, "Time" text ) ### Response: SELECT "Brand" FROM table_65340 WHERE "Entrant" = 'mark henry'
How many profits is the company that is headquartered in the USA, in the banking industry, and has sales (billion $) less than 98.64 bringing in?
CREATE TABLE table_name_54 ( profits__billion_ INTEGER, sales__billion_$_ VARCHAR, headquarters VARCHAR, industry VARCHAR )
SELECT SUM(profits__billion_) AS $_ FROM table_name_54 WHERE headquarters = "usa" AND industry = "banking" AND sales__billion_$_ < 98.64
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many profits is the company that is headquartered in the USA, in the banking industry, and has sales (billion $) less than 98.64 bringing in? ### Input: CREATE TABLE table_name_54 ( profits__billion_ INTEGER, sales__billion_$_ VARCHAR, headquarters VARCHAR, industry VARCHAR ) ### Response: SELECT SUM(profits__billion_) AS $_ FROM table_name_54 WHERE headquarters = "usa" AND industry = "banking" AND sales__billion_$_ < 98.64
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the average of manufacturer , and group by attribute name, and order by the Y in ascending.
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 T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Manufacturer
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the average of manufacturer , and group by attribute name, and order by the Y in ascending. ### Input: 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 ) ### Response: SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Manufacturer
Bin the settlement date for each settlement case into the day of week interval and count them for visualizing a bar chart, show by the Y-axis in desc.
CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATE, End_Date DATE ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER ) CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER )
SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Settlements ORDER BY COUNT(Date_Claim_Settled) DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bin the settlement date for each settlement case into the day of week interval and count them for visualizing a bar chart, show by the Y-axis in desc. ### Input: CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATE, End_Date DATE ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER ) CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) ### Response: SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Settlements ORDER BY COUNT(Date_Claim_Settled) DESC
How many Starts that have Cuts made of 2, Top 25 larger than 0, and Earnings ($) smaller than 338,067?
CREATE TABLE table_name_66 ( starts VARCHAR, earnings__$_ VARCHAR, cuts_made VARCHAR, top_25 VARCHAR )
SELECT COUNT(starts) FROM table_name_66 WHERE cuts_made = 2 AND top_25 > 0 AND earnings__$_ < 338 OFFSET 067
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many Starts that have Cuts made of 2, Top 25 larger than 0, and Earnings ($) smaller than 338,067? ### Input: CREATE TABLE table_name_66 ( starts VARCHAR, earnings__$_ VARCHAR, cuts_made VARCHAR, top_25 VARCHAR ) ### Response: SELECT COUNT(starts) FROM table_name_66 WHERE cuts_made = 2 AND top_25 > 0 AND earnings__$_ < 338 OFFSET 067
What is the number of the game that was played in the time of 2:38?
CREATE TABLE table_name_95 ( game INTEGER, time VARCHAR )
SELECT MAX(game) FROM table_name_95 WHERE time = "2:38"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the number of the game that was played in the time of 2:38? ### Input: CREATE TABLE table_name_95 ( game INTEGER, time VARCHAR ) ### Response: SELECT MAX(game) FROM table_name_95 WHERE time = "2:38"
how many total clubs are listed ?
CREATE TABLE table_203_581 ( id number, "club" text, "chinese" text, "city" text, "home stadium" text, "capacity" number, "average attendance" number )
SELECT COUNT("club") FROM table_203_581
squall
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many total clubs are listed ? ### Input: CREATE TABLE table_203_581 ( id number, "club" text, "chinese" text, "city" text, "home stadium" text, "capacity" number, "average attendance" number ) ### Response: SELECT COUNT("club") FROM table_203_581
What is the Notes of the Frequency with Call sign CFUN-FM-1?
CREATE TABLE table_name_33 ( notes VARCHAR, call_sign VARCHAR )
SELECT notes FROM table_name_33 WHERE call_sign = "cfun-fm-1"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Notes of the Frequency with Call sign CFUN-FM-1? ### Input: CREATE TABLE table_name_33 ( notes VARCHAR, call_sign VARCHAR ) ### Response: SELECT notes FROM table_name_33 WHERE call_sign = "cfun-fm-1"
What Player Club Team is Indiana Ice (ushl)?
CREATE TABLE table_name_10 ( player VARCHAR, club_team VARCHAR )
SELECT player FROM table_name_10 WHERE club_team = "indiana ice (ushl)"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Player Club Team is Indiana Ice (ushl)? ### Input: CREATE TABLE table_name_10 ( player VARCHAR, club_team VARCHAR ) ### Response: SELECT player FROM table_name_10 WHERE club_team = "indiana ice (ushl)"
What is the Kanji for the Ayanami dd-45?
CREATE TABLE table_34249 ( "Kanji" text, "Name" text, "Builder" text, "Laid down" text, "Launched" text, "Completed" text )
SELECT "Kanji" FROM table_34249 WHERE "Name" = 'ayanami dd-45'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Kanji for the Ayanami dd-45? ### Input: CREATE TABLE table_34249 ( "Kanji" text, "Name" text, "Builder" text, "Laid down" text, "Launched" text, "Completed" text ) ### Response: SELECT "Kanji" FROM table_34249 WHERE "Name" = 'ayanami dd-45'
What was the nationality of player picked no. 179?
CREATE TABLE table_2679061_9 ( nationality VARCHAR, pick__number VARCHAR )
SELECT nationality FROM table_2679061_9 WHERE pick__number = 179
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the nationality of player picked no. 179? ### Input: CREATE TABLE table_2679061_9 ( nationality VARCHAR, pick__number VARCHAR ) ### Response: SELECT nationality FROM table_2679061_9 WHERE pick__number = 179
Which department has the highest average student GPA, and what is the average gpa?
CREATE TABLE class ( class_code text, crs_code text, class_section text, class_time text, class_room text, prof_num number ) CREATE TABLE student ( stu_num number, stu_lname text, stu_fname text, stu_init text, stu_dob time, stu_hrs number, stu_class text, stu_gpa number, stu_transfer number, dept_code text, stu_phone text, prof_num number ) CREATE TABLE department ( dept_code text, dept_name text, school_code text, emp_num number, dept_address text, dept_extension text ) CREATE TABLE enroll ( class_code text, stu_num number, enroll_grade text ) CREATE TABLE course ( crs_code text, dept_code text, crs_description text, crs_credit number ) CREATE TABLE professor ( emp_num number, dept_code text, prof_office text, prof_extension text, prof_high_degree text ) CREATE TABLE employee ( emp_num number, emp_lname text, emp_fname text, emp_initial text, emp_jobcode text, emp_hiredate time, emp_dob time )
SELECT T2.dept_name, AVG(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY AVG(T1.stu_gpa) DESC LIMIT 1
spider
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which department has the highest average student GPA, and what is the average gpa? ### Input: CREATE TABLE class ( class_code text, crs_code text, class_section text, class_time text, class_room text, prof_num number ) CREATE TABLE student ( stu_num number, stu_lname text, stu_fname text, stu_init text, stu_dob time, stu_hrs number, stu_class text, stu_gpa number, stu_transfer number, dept_code text, stu_phone text, prof_num number ) CREATE TABLE department ( dept_code text, dept_name text, school_code text, emp_num number, dept_address text, dept_extension text ) CREATE TABLE enroll ( class_code text, stu_num number, enroll_grade text ) CREATE TABLE course ( crs_code text, dept_code text, crs_description text, crs_credit number ) CREATE TABLE professor ( emp_num number, dept_code text, prof_office text, prof_extension text, prof_high_degree text ) CREATE TABLE employee ( emp_num number, emp_lname text, emp_fname text, emp_initial text, emp_jobcode text, emp_hiredate time, emp_dob time ) ### Response: SELECT T2.dept_name, AVG(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY AVG(T1.stu_gpa) DESC LIMIT 1
what's the name of the drug that was first prescribed to patient 60136?
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod 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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name 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_labitems ( row_id number, itemid number, label 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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text )
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60136) ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the name of the drug that was first prescribed to patient 60136? ### Input: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod 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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name 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_labitems ( row_id number, itemid number, label 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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) ### Response: SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60136) ORDER BY prescriptions.startdate LIMIT 1
body mass index range ( 25 _ 38 kg / m2 ) with type ii diabetes mellitus receiving stable dose of metformin bid for the previous 60 days for glucose control
CREATE TABLE table_train_232 ( "id" int, "metastatic_cancer" bool, "hemoglobin_a1c_hba1c" float, "diabetic" string, "short_life_expectancy" bool, "body_mass_index_bmi" float, "a1c" float, "NOUSE" float )
SELECT * FROM table_train_232 WHERE body_mass_index_bmi >= 25 AND body_mass_index_bmi <= 38 AND diabetic = 'ii'
criteria2sql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: body mass index range ( 25 _ 38 kg / m2 ) with type ii diabetes mellitus receiving stable dose of metformin bid for the previous 60 days for glucose control ### Input: CREATE TABLE table_train_232 ( "id" int, "metastatic_cancer" bool, "hemoglobin_a1c_hba1c" float, "diabetic" string, "short_life_expectancy" bool, "body_mass_index_bmi" float, "a1c" float, "NOUSE" float ) ### Response: SELECT * FROM table_train_232 WHERE body_mass_index_bmi >= 25 AND body_mass_index_bmi <= 38 AND diabetic = 'ii'
If the spectral type is g1v, what is the constellation?
CREATE TABLE table_1820752_1 ( constellation VARCHAR, spectral_type VARCHAR )
SELECT constellation FROM table_1820752_1 WHERE spectral_type = "G1V"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the spectral type is g1v, what is the constellation? ### Input: CREATE TABLE table_1820752_1 ( constellation VARCHAR, spectral_type VARCHAR ) ### Response: SELECT constellation FROM table_1820752_1 WHERE spectral_type = "G1V"
What is the average number of points scored by Joe Vagana when making fewer than 2 tries?
CREATE TABLE table_name_46 ( points INTEGER, player VARCHAR, tries VARCHAR )
SELECT AVG(points) FROM table_name_46 WHERE player = "joe vagana" AND tries < 2
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average number of points scored by Joe Vagana when making fewer than 2 tries? ### Input: CREATE TABLE table_name_46 ( points INTEGER, player VARCHAR, tries VARCHAR ) ### Response: SELECT AVG(points) FROM table_name_46 WHERE player = "joe vagana" AND tries < 2
who is the only country to win only golds ?
CREATE TABLE table_204_211 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
SELECT "nation" FROM table_204_211 WHERE "silver" = 0 AND "bronze" = 0
squall
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who is the only country to win only golds ? ### Input: CREATE TABLE table_204_211 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) ### Response: SELECT "nation" FROM table_204_211 WHERE "silver" = 0 AND "bronze" = 0
Name the away team score for geelong away team
CREATE TABLE table_name_25 ( away_team VARCHAR )
SELECT away_team AS score FROM table_name_25 WHERE away_team = "geelong"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the away team score for geelong away team ### Input: CREATE TABLE table_name_25 ( away_team VARCHAR ) ### Response: SELECT away_team AS score FROM table_name_25 WHERE away_team = "geelong"
High View Counts with no Images. Questions whos answers don't have any screenshots but have a very high view count
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId 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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE FlagTypes ( 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 PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE VoteTypes ( Id number, Name 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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId 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 PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskTypes ( 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 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 ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text )
SELECT P.Id AS "post_link", P.Score, P.ViewCount FROM Posts AS P WHERE P.ClosedDate IS NULL AND P.PostTypeId = 1 AND P.AnswerCount >= 1 AND P.Id NOT IN (SELECT A.ParentId FROM Posts AS A WHERE A.PostTypeId = 2 AND A.Score >= 2 AND A.Body LIKE '%imgur%') ORDER BY P.ViewCount DESC
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: High View Counts with no Images. Questions whos answers don't have any screenshots but have a very high view count ### Input: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId 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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE FlagTypes ( 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 PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE VoteTypes ( Id number, Name 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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId 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 PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskTypes ( 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 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 ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) ### Response: SELECT P.Id AS "post_link", P.Score, P.ViewCount FROM Posts AS P WHERE P.ClosedDate IS NULL AND P.PostTypeId = 1 AND P.AnswerCount >= 1 AND P.Id NOT IN (SELECT A.ParentId FROM Posts AS A WHERE A.PostTypeId = 2 AND A.Score >= 2 AND A.Body LIKE '%imgur%') ORDER BY P.ViewCount DESC
Which Date has a Score of 24-7, and a Record of 4-10?
CREATE TABLE table_name_12 ( date VARCHAR, score VARCHAR, record VARCHAR )
SELECT date FROM table_name_12 WHERE score = "24-7" AND record = "4-10"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Date has a Score of 24-7, and a Record of 4-10? ### Input: CREATE TABLE table_name_12 ( date VARCHAR, score VARCHAR, record VARCHAR ) ### Response: SELECT date FROM table_name_12 WHERE score = "24-7" AND record = "4-10"
In the year 2009 who was the under-13?
CREATE TABLE table_28600 ( "Year" real, "Under-11" text, "Under-13" text, "Under-15" text, "Under-17" text, "Under-19" text )
SELECT "Under-13" FROM table_28600 WHERE "Year" = '2009'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In the year 2009 who was the under-13? ### Input: CREATE TABLE table_28600 ( "Year" real, "Under-11" text, "Under-13" text, "Under-15" text, "Under-17" text, "Under-19" text ) ### Response: SELECT "Under-13" FROM table_28600 WHERE "Year" = '2009'
When the Home team of geelong played, what was their lowest Crowd number?
CREATE TABLE table_name_23 ( crowd INTEGER, home_team VARCHAR )
SELECT MIN(crowd) FROM table_name_23 WHERE home_team = "geelong"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the Home team of geelong played, what was their lowest Crowd number? ### Input: CREATE TABLE table_name_23 ( crowd INTEGER, home_team VARCHAR ) ### Response: SELECT MIN(crowd) FROM table_name_23 WHERE home_team = "geelong"
How many picks had a round smaller than 6 and an overall bigger than 153?
CREATE TABLE table_name_47 ( pick INTEGER, round VARCHAR, overall VARCHAR )
SELECT SUM(pick) FROM table_name_47 WHERE round < 6 AND overall > 153
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many picks had a round smaller than 6 and an overall bigger than 153? ### Input: CREATE TABLE table_name_47 ( pick INTEGER, round VARCHAR, overall VARCHAR ) ### Response: SELECT SUM(pick) FROM table_name_47 WHERE round < 6 AND overall > 153
what are patient 012-169's gender?
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 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 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 medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '012-169'
eicu
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are patient 012-169's gender? ### Input: 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 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 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 medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) ### Response: SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '012-169'
Plot a scatter chart, order id by the total number .
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,4), transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255) ) CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80), product_quantity VARCHAR(50), product_price DECIMAL(19,4), derived_product_cost DECIMAL(19,4), derived_vat_payable DECIMAL(19,4), derived_total_cost DECIMAL(19,4) ) CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, date_account_opened DATETIME, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) ) CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME ) CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4) ) CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(50), customer_middle_initial VARCHAR(1), customer_last_name VARCHAR(50), gender VARCHAR(1), email_address VARCHAR(255), login_name VARCHAR(80), login_password VARCHAR(20), phone_number VARCHAR(255), town_city VARCHAR(50), state_county_province VARCHAR(50), country VARCHAR(50) ) CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, product_quantity VARCHAR(50), other_order_item_details VARCHAR(255) ) CREATE TABLE Products ( product_id INTEGER, parent_product_id INTEGER, production_type_code VARCHAR(15), unit_price DECIMAL(19,4), product_name VARCHAR(80), product_color VARCHAR(20), product_size VARCHAR(20) )
SELECT order_id, COUNT(*) FROM Invoices GROUP BY order_id
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Plot a scatter chart, order id by the total number . ### Input: CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,4), transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255) ) CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80), product_quantity VARCHAR(50), product_price DECIMAL(19,4), derived_product_cost DECIMAL(19,4), derived_vat_payable DECIMAL(19,4), derived_total_cost DECIMAL(19,4) ) CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, date_account_opened DATETIME, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) ) CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME ) CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4) ) CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(50), customer_middle_initial VARCHAR(1), customer_last_name VARCHAR(50), gender VARCHAR(1), email_address VARCHAR(255), login_name VARCHAR(80), login_password VARCHAR(20), phone_number VARCHAR(255), town_city VARCHAR(50), state_county_province VARCHAR(50), country VARCHAR(50) ) CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, product_quantity VARCHAR(50), other_order_item_details VARCHAR(255) ) CREATE TABLE Products ( product_id INTEGER, parent_product_id INTEGER, production_type_code VARCHAR(15), unit_price DECIMAL(19,4), product_name VARCHAR(80), product_color VARCHAR(20), product_size VARCHAR(20) ) ### Response: SELECT order_id, COUNT(*) FROM Invoices GROUP BY order_id
Name the Player who has a Country of united states, and a To par of 5?
CREATE TABLE table_name_73 ( player VARCHAR, country VARCHAR, to_par VARCHAR )
SELECT player FROM table_name_73 WHERE country = "united states" AND to_par = "–5"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the Player who has a Country of united states, and a To par of 5? ### Input: CREATE TABLE table_name_73 ( player VARCHAR, country VARCHAR, to_par VARCHAR ) ### Response: SELECT player FROM table_name_73 WHERE country = "united states" AND to_par = "–5"
What is the Semi finalists when the Runner-up was katrina adams zina garrison-jackson?
CREATE TABLE table_40286 ( "Week of" text, "Tier" text, "Winner" text, "Runner-up" text, "Semi finalists" text )
SELECT "Semi finalists" FROM table_40286 WHERE "Runner-up" = 'katrina adams zina garrison-jackson'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Semi finalists when the Runner-up was katrina adams zina garrison-jackson? ### Input: CREATE TABLE table_40286 ( "Week of" text, "Tier" text, "Winner" text, "Runner-up" text, "Semi finalists" text ) ### Response: SELECT "Semi finalists" FROM table_40286 WHERE "Runner-up" = 'katrina adams zina garrison-jackson'
What is the size difference for exa?
CREATE TABLE table_name_29 ( size_difference VARCHAR, prefix VARCHAR )
SELECT size_difference FROM table_name_29 WHERE prefix = "exa"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the size difference for exa? ### Input: CREATE TABLE table_name_29 ( size_difference VARCHAR, prefix VARCHAR ) ### Response: SELECT size_difference FROM table_name_29 WHERE prefix = "exa"
Where was the game with the result of 22-20 played?
CREATE TABLE table_11982 ( "Date" text, "Venue" text, "Opponent" text, "Result" text, "Tournament" text, "Scored" real )
SELECT "Venue" FROM table_11982 WHERE "Result" = '22-20'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where was the game with the result of 22-20 played? ### Input: CREATE TABLE table_11982 ( "Date" text, "Venue" text, "Opponent" text, "Result" text, "Tournament" text, "Scored" real ) ### Response: SELECT "Venue" FROM table_11982 WHERE "Result" = '22-20'
What poll had Steve Poizner at 37%?
CREATE TABLE table_70597 ( "Poll source" text, "Date(s) administered" text, "Tom Campbell*" text, "Meg Whitman" text, "Steve Poizner" text, "Peter Foy*" text )
SELECT "Poll source" FROM table_70597 WHERE "Steve Poizner" = '37%'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What poll had Steve Poizner at 37%? ### Input: CREATE TABLE table_70597 ( "Poll source" text, "Date(s) administered" text, "Tom Campbell*" text, "Meg Whitman" text, "Steve Poizner" text, "Peter Foy*" text ) ### Response: SELECT "Poll source" FROM table_70597 WHERE "Steve Poizner" = '37%'
Name the type with cancelable of no and attribute of ondragend
CREATE TABLE table_name_79 ( type VARCHAR, cancelable VARCHAR, attribute VARCHAR )
SELECT type FROM table_name_79 WHERE cancelable = "no" AND attribute = "ondragend"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the type with cancelable of no and attribute of ondragend ### Input: CREATE TABLE table_name_79 ( type VARCHAR, cancelable VARCHAR, attribute VARCHAR ) ### Response: SELECT type FROM table_name_79 WHERE cancelable = "no" AND attribute = "ondragend"
What is the Date, when the Opponent is Gisela Dulko?
CREATE TABLE table_14823 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
SELECT "Date" FROM table_14823 WHERE "Opponent" = 'gisela dulko'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Date, when the Opponent is Gisela Dulko? ### Input: CREATE TABLE table_14823 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) ### Response: SELECT "Date" FROM table_14823 WHERE "Opponent" = 'gisela dulko'
Which rider had more than 23 laps, a manufacturer of Aprilia, and a grid of 14
CREATE TABLE table_66868 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT "Rider" FROM table_66868 WHERE "Laps" > '23' AND "Manufacturer" = 'aprilia' AND "Grid" = '14'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which rider had more than 23 laps, a manufacturer of Aprilia, and a grid of 14 ### Input: CREATE TABLE table_66868 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real ) ### Response: SELECT "Rider" FROM table_66868 WHERE "Laps" > '23' AND "Manufacturer" = 'aprilia' AND "Grid" = '14'
Compare the total enrollment in each county with a bar chart.
CREATE TABLE endowment ( endowment_id int, School_id int, donator_name text, amount real ) CREATE TABLE School ( School_id text, School_name text, Location text, Mascot text, Enrollment int, IHSAA_Class text, IHSAA_Football_Class text, County text ) CREATE TABLE budget ( School_id int, Year int, Budgeted int, total_budget_percent_budgeted real, Invested int, total_budget_percent_invested real, Budget_invested_percent text )
SELECT County, SUM(Enrollment) FROM School GROUP BY County
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Compare the total enrollment in each county with a bar chart. ### Input: CREATE TABLE endowment ( endowment_id int, School_id int, donator_name text, amount real ) CREATE TABLE School ( School_id text, School_name text, Location text, Mascot text, Enrollment int, IHSAA_Class text, IHSAA_Football_Class text, County text ) CREATE TABLE budget ( School_id int, Year int, Budgeted int, total_budget_percent_budgeted real, Invested int, total_budget_percent_invested real, Budget_invested_percent text ) ### Response: SELECT County, SUM(Enrollment) FROM School GROUP BY County
Show all the cinema names and opening years in descending order of opening year.
CREATE TABLE schedule ( cinema_id number, film_id number, date text, show_times_per_day number, price number ) CREATE TABLE film ( film_id number, rank_in_series number, number_in_season number, title text, directed_by text, original_air_date text, production_code text ) CREATE TABLE cinema ( cinema_id number, name text, openning_year number, capacity number, location text )
SELECT name, openning_year FROM cinema ORDER BY openning_year DESC
spider
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all the cinema names and opening years in descending order of opening year. ### Input: CREATE TABLE schedule ( cinema_id number, film_id number, date text, show_times_per_day number, price number ) CREATE TABLE film ( film_id number, rank_in_series number, number_in_season number, title text, directed_by text, original_air_date text, production_code text ) CREATE TABLE cinema ( cinema_id number, name text, openning_year number, capacity number, location text ) ### Response: SELECT name, openning_year FROM cinema ORDER BY openning_year DESC
How many dead patients were less than 41 years of age?
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 ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DEAD/EXPIRED" AND demographic.age < "41"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many dead patients were less than 41 years of age? ### Input: 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 ) 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 ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DEAD/EXPIRED" AND demographic.age < "41"
For those employees who was hired before 2002-06-21, find hire_date and the average of manager_id bin hire_date by weekday, and visualize them by a bar chart, sort the average of manager id in asc order.
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 job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) )
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(MANAGER_ID)
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, find hire_date and the average of manager_id bin hire_date by weekday, and visualize them by a bar chart, sort the average of manager id in asc order. ### Input: 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 job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) ### Response: SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(MANAGER_ID)
What was the score of the French Open?
CREATE TABLE table_name_7 ( score_in_the_final VARCHAR, championship VARCHAR )
SELECT score_in_the_final FROM table_name_7 WHERE championship = "french open"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score of the French Open? ### Input: CREATE TABLE table_name_7 ( score_in_the_final VARCHAR, championship VARCHAR ) ### Response: SELECT score_in_the_final FROM table_name_7 WHERE championship = "french open"
What's the total of Year that's got a Team of Porsche Kremer Racing?
CREATE TABLE table_6251 ( "Year" real, "Class" text, "Team" text, "Chassis" text, "Tyre" text, "Laps" real )
SELECT SUM("Year") FROM table_6251 WHERE "Team" = 'porsche kremer racing'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the total of Year that's got a Team of Porsche Kremer Racing? ### Input: CREATE TABLE table_6251 ( "Year" real, "Class" text, "Team" text, "Chassis" text, "Tyre" text, "Laps" real ) ### Response: SELECT SUM("Year") FROM table_6251 WHERE "Team" = 'porsche kremer racing'
What was the score of Game 48?
CREATE TABLE table_name_33 ( score VARCHAR, game VARCHAR )
SELECT score FROM table_name_33 WHERE game = 48
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score of Game 48? ### Input: CREATE TABLE table_name_33 ( score VARCHAR, game VARCHAR ) ### Response: SELECT score FROM table_name_33 WHERE game = 48
Which class is easiest to fulfill the MDE requirement for me ?
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar )
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%MDE%')
advising
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which class is easiest to fulfill the MDE requirement for me ? ### Input: CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) ### Response: SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%MDE%')
list all DAILY flights between OAKLAND and BOSTON using AA
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 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 airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) 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 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 equipment_sequence ( aircraft_code_sequence varchar, aircraft_code 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 date_day ( month_number int, day_number int, year int, day_name varchar ) 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 ) 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 DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'AA') AND flight.flight_days = 'DAILY'
atis
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list all DAILY flights between OAKLAND and BOSTON using AA ### Input: 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 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 airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) 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 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 equipment_sequence ( aircraft_code_sequence varchar, aircraft_code 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 date_day ( month_number int, day_number int, year int, day_name varchar ) 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 ) 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 ) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'AA') AND flight.flight_days = 'DAILY'
body mass index > 30 kg / m2
CREATE TABLE table_train_271 ( "id" int, "renal_disease" bool, "hepatic_disease" bool, "smoking" bool, "coronary_artery_disease_cad" bool, "serum_creatinine" float, "body_mass_index_bmi" float, "myocardial_infarction" bool, "NOUSE" float )
SELECT * FROM table_train_271 WHERE body_mass_index_bmi > 30
criteria2sql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: body mass index > 30 kg / m2 ### Input: CREATE TABLE table_train_271 ( "id" int, "renal_disease" bool, "hepatic_disease" bool, "smoking" bool, "coronary_artery_disease_cad" bool, "serum_creatinine" float, "body_mass_index_bmi" float, "myocardial_infarction" bool, "NOUSE" float ) ### Response: SELECT * FROM table_train_271 WHERE body_mass_index_bmi > 30
how many students are advised by each rank of faculty? List the rank and the number of students, order by the the total number from high to low.
CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER )
SELECT Rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.Rank ORDER BY COUNT(*) DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many students are advised by each rank of faculty? List the rank and the number of students, order by the the total number from high to low. ### Input: CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) ### Response: SELECT Rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.Rank ORDER BY COUNT(*) DESC
what was this actor 's first television role ?
CREATE TABLE table_204_729 ( id number, "year" text, "show" text, "role" text, "channel" text, "notes" text )
SELECT "role" FROM table_204_729 ORDER BY "year" LIMIT 1
squall
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was this actor 's first television role ? ### Input: CREATE TABLE table_204_729 ( id number, "year" text, "show" text, "role" text, "channel" text, "notes" text ) ### Response: SELECT "role" FROM table_204_729 ORDER BY "year" LIMIT 1
count the number of patients whose death status is 1 and days of hospital stay is greater than 14?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.days_stay > "14"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose death status is 1 and days of hospital stay is greater than 14? ### Input: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.days_stay > "14"
What was the vote when the air date is 4 october 1997?
CREATE TABLE table_25016824_2 ( vote VARCHAR, air_date VARCHAR )
SELECT vote FROM table_25016824_2 WHERE air_date = "4 October 1997"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the vote when the air date is 4 october 1997? ### Input: CREATE TABLE table_25016824_2 ( vote VARCHAR, air_date VARCHAR ) ### Response: SELECT vote FROM table_25016824_2 WHERE air_date = "4 October 1997"
Average response time by tags. The average response time for most popular tags (with at least one vote)
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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostHistoryTypes ( Id number, Name 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId 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 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 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 PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId 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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId 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 PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
SELECT COUNT(DISTINCT Id) AS responses, AVG(CAST((JULIANDAY(ClosedDate) - JULIANDAY(CreationDate)) * 24.0 AS INT)) AS average_response_time_in_hours FROM Posts WHERE CreationDate >= '2020-09-2' AND ClosedDate <= '2020-09-28'
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Average response time by tags. The average response time for most popular tags (with at least one vote) ### Input: 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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostHistoryTypes ( Id number, Name 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId 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 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 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 PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId 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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId 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 PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) ### Response: SELECT COUNT(DISTINCT Id) AS responses, AVG(CAST((JULIANDAY(ClosedDate) - JULIANDAY(CreationDate)) * 24.0 AS INT)) AS average_response_time_in_hours FROM Posts WHERE CreationDate >= '2020-09-2' AND ClosedDate <= '2020-09-28'
What day is their record 13-15?
CREATE TABLE table_37347 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
SELECT "Date" FROM table_37347 WHERE "Record" = '13-15'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What day is their record 13-15? ### Input: CREATE TABLE table_37347 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) ### Response: SELECT "Date" FROM table_37347 WHERE "Record" = '13-15'
Who was the writer for the show titled 'and the rocky goes to...'?
CREATE TABLE table_26033 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (in millions)" text )
SELECT "Written by" FROM table_26033 WHERE "Title" = 'And the Rocky Goes To...'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the writer for the show titled 'and the rocky goes to...'? ### Input: CREATE TABLE table_26033 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (in millions)" text ) ### Response: SELECT "Written by" FROM table_26033 WHERE "Title" = 'And the Rocky Goes To...'
what's the doubles w-l with years played value of 1 (1968)
CREATE TABLE table_10023387_1 ( doubles_w_l VARCHAR, years_played VARCHAR )
SELECT doubles_w_l FROM table_10023387_1 WHERE years_played = "1 (1968)"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the doubles w-l with years played value of 1 (1968) ### Input: CREATE TABLE table_10023387_1 ( doubles_w_l VARCHAR, years_played VARCHAR ) ### Response: SELECT doubles_w_l FROM table_10023387_1 WHERE years_played = "1 (1968)"
Name the straight to number 1 for tribal king
CREATE TABLE table_3763 ( "Artist" text, "Country" text, "Number-one single(s)" text, "Year" real, "Weeks at #1" real, "Straight to #1 ?" text )
SELECT "Straight to #1 ?" FROM table_3763 WHERE "Artist" = 'Tribal King'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the straight to number 1 for tribal king ### Input: CREATE TABLE table_3763 ( "Artist" text, "Country" text, "Number-one single(s)" text, "Year" real, "Weeks at #1" real, "Straight to #1 ?" text ) ### Response: SELECT "Straight to #1 ?" FROM table_3763 WHERE "Artist" = 'Tribal King'
how many patients marital status is divorced and diagnoses is pressure ulcer, stage i?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE 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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.long_title = "Pressure ulcer, stage I"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients marital status is divorced and diagnoses is pressure ulcer, stage i? ### Input: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE 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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.long_title = "Pressure ulcer, stage I"