Instruction: Find retaggable AS questions that are open or don't roomba.

Input:
CREATE TABLE CloseReasonTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE PostTags (
    PostId number,
    TagId number
)

CREATE TABLE ReviewTaskStates (
    Id number,
    Name text,
    Description text
)

CREATE TABLE PostFeedback (
    Id number,
    PostId number,
    IsAnonymous boolean,
    VoteTypeId number,
    CreationDate time
)

CREATE TABLE ReviewTaskTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE Tags (
    Id number,
    TagName text,
    Count number,
    ExcerptPostId number,
    WikiPostId 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 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 Votes (
    Id number,
    PostId number,
    VoteTypeId number,
    UserId number,
    CreationDate time,
    BountyAmount number
)

CREATE TABLE ReviewRejectionReasons (
    Id number,
    Name text,
    Description text,
    PostTypeId 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 ReviewTaskResults (
    Id number,
    ReviewTaskId number,
    ReviewTaskResultTypeId number,
    CreationDate time,
    RejectionReasonId number,
    Comment 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 PostHistoryTypes (
    Id number,
    Name text
)

CREATE TABLE TagSynonyms (
    Id number,
    SourceTagName text,
    TargetTagName text,
    CreationDate time,
    OwnerUserId number,
    AutoRenameCount number,
    LastAutoRename time,
    Score number,
    ApprovedByUserId number,
    ApprovalDate time
)

CREATE TABLE VoteTypes (
    Id number,
    Name text
)

CREATE TABLE PostLinks (
    Id number,
    CreationDate time,
    PostId number,
    RelatedPostId number,
    LinkTypeId number
)

CREATE TABLE ReviewTaskResultTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE PostHistory (
    Id number,
    PostHistoryTypeId number,
    PostId number,
    RevisionGUID other,
    CreationDate time,
    UserId number,
    UserDisplayName text,
    Comment text,
    Text text,
    ContentLicense text
)

CREATE TABLE PostNoticeTypes (
    Id number,
    ClassId number,
    Name text,
    Body text,
    IsHidden boolean,
    Predefined boolean,
    PostNoticeDurationId number
)

CREATE TABLE SuggestedEditVotes (
    Id number,
    SuggestedEditId number,
    UserId number,
    VoteTypeId number,
    CreationDate time,
    TargetUserId number,
    TargetRepChange number
)

CREATE TABLE FlagTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE SuggestedEdits (
    Id number,
    PostId number,
    CreationDate time,
    ApprovalDate time,
    RejectionDate time,
    OwnerUserId number,
    Comment text,
    Text text,
    Title text,
    Tags text,
    RevisionGUID other
)

CREATE TABLE PostTypes (
    Id number,
    Name text
)

CREATE TABLE Badges (
    Id number,
    UserId number,
    Name text,
    Date time,
    Class number,
    TagBased boolean
)

CREATE TABLE Comments (
    Id number,
    PostId number,
    Score number,
    Text text,
    CreationDate time,
    UserDisplayName text,
    UserId number,
    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 PendingFlags (
    Id number,
    FlagTypeId number,
    PostId number,
    CreationDate time,
    CloseReasonTypeId number,
    CloseAsOffTopicReasonTypeId number,
    DuplicateOfQuestionId number,
    BelongsOnBaseHostAddress text
)

Response: SELECT Id AS "post_link", Body, Tags, Score, AnswerCount, CommentCount FROM Posts WHERE PostTypeId = 1 AND ((Score <= 0 AND AnswerCount > 0 AND (AcceptedAnswerId = NULL OR AcceptedAnswerId > 0)) OR (Score = 0 AND CommentCount > 0) OR (Score > 0)) ORDER BY CreationDate DESC LIMIT 1000

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 retaggable AS questions that are open or don't roomba. ### Input: CREATE TABLE CloseReasonTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE PostTags (
    PostId number,
    TagId number
)

CREATE TABLE ReviewTaskStates (
    Id number,
    Name text,
    Description text
)

CREATE TABLE PostFeedback (
    Id number,
    PostId number,
    IsAnonymous boolean,
    VoteTypeId number,
    CreationDate time
)

CREATE TABLE ReviewTaskTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE Tags (
    Id number,
    TagName text,
    Count number,
    ExcerptPostId number,
    WikiPostId 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 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 Votes (
    Id number,
    PostId number,
    VoteTypeId number,
    UserId number,
    CreationDate time,
    BountyAmount number
)

CREATE TABLE ReviewRejectionReasons (
    Id number,
    Name text,
    Description text,
    PostTypeId 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 ReviewTaskResults (
    Id number,
    ReviewTaskId number,
    ReviewTaskResultTypeId number,
    CreationDate time,
    RejectionReasonId number,
    Comment 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 PostHistoryTypes (
    Id number,
    Name text
)

CREATE TABLE TagSynonyms (
    Id number,
    SourceTagName text,
    TargetTagName text,
    CreationDate time,
    OwnerUserId number,
    AutoRenameCount number,
    LastAutoRename time,
    Score number,
    ApprovedByUserId number,
    ApprovalDate time
)

CREATE TABLE VoteTypes (
    Id number,
    Name text
)

CREATE TABLE PostLinks (
    Id number,
    CreationDate time,
    PostId number,
    RelatedPostId number,
    LinkTypeId number
)

CREATE TABLE ReviewTaskResultTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE PostHistory (
    Id number,
    PostHistoryTypeId number,
    PostId number,
    RevisionGUID other,
    CreationDate time,
    UserId number,
    UserDisplayName text,
    Comment text,
    Text text,
    ContentLicense text
)

CREATE TABLE PostNoticeTypes (
    Id number,
    ClassId number,
    Name text,
    Body text,
    IsHidden boolean,
    Predefined boolean,
    PostNoticeDurationId number
)

CREATE TABLE SuggestedEditVotes (
    Id number,
    SuggestedEditId number,
    UserId number,
    VoteTypeId number,
    CreationDate time,
    TargetUserId number,
    TargetRepChange number
)

CREATE TABLE FlagTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE SuggestedEdits (
    Id number,
    PostId number,
    CreationDate time,
    ApprovalDate time,
    RejectionDate time,
    OwnerUserId number,
    Comment text,
    Text text,
    Title text,
    Tags text,
    RevisionGUID other
)

CREATE TABLE PostTypes (
    Id number,
    Name text
)

CREATE TABLE Badges (
    Id number,
    UserId number,
    Name text,
    Date time,
    Class number,
    TagBased boolean
)

CREATE TABLE Comments (
    Id number,
    PostId number,
    Score number,
    Text text,
    CreationDate time,
    UserDisplayName text,
    UserId number,
    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 PendingFlags (
    Id number,
    FlagTypeId number,
    PostId number,
    CreationDate time,
    CloseReasonTypeId number,
    CloseAsOffTopicReasonTypeId number,
    DuplicateOfQuestionId number,
    BelongsOnBaseHostAddress text
) ### Response: SELECT Id AS "post_link", Body, Tags, Score, AnswerCount, CommentCount FROM Posts WHERE PostTypeId = 1 AND ((Score <= 0 AND AnswerCount > 0 AND (AcceptedAnswerId = NULL OR AcceptedAnswerId > 0)) OR (Score = 0 AND CommentCount > 0) OR (Score > 0)) ORDER BY CreationDate DESC LIMIT 1000


Instruction: what are the four most frequent specimen tests that patients had within the same month after having been diagnosed with 29-30 comp wks gestation until 2104?

Input:
CREATE TABLE d_icd_procedures (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE outputevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    value number
)

CREATE TABLE admissions (
    row_id number,
    subject_id number,
    hadm_id number,
    admittime time,
    dischtime time,
    admission_type text,
    admission_location text,
    discharge_location text,
    insurance text,
    language text,
    marital_status text,
    ethnicity text,
    age number
)

CREATE TABLE d_icd_diagnoses (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE icustays (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    first_careunit text,
    last_careunit text,
    first_wardid number,
    last_wardid number,
    intime time,
    outtime time
)

CREATE TABLE procedures_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

CREATE TABLE transfers (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    eventtype text,
    careunit text,
    wardid number,
    intime time,
    outtime time
)

CREATE TABLE d_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 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 chartevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

CREATE TABLE cost (
    row_id number,
    subject_id number,
    hadm_id number,
    event_type text,
    event_id number,
    chargetime time,
    cost number
)

CREATE TABLE diagnoses_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

CREATE TABLE microbiologyevents (
    row_id number,
    subject_id number,
    hadm_id number,
    charttime time,
    spec_type_desc text,
    org_name text
)

CREATE TABLE prescriptions (
    row_id number,
    subject_id number,
    hadm_id number,
    startdate time,
    enddate time,
    drug text,
    dose_val_rx text,
    dose_unit_rx text,
    route text
)

CREATE TABLE labevents (
    row_id number,
    subject_id number,
    hadm_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

Response: SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = '29-30 comp wks gestation') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2104') AS t1 JOIN (SELECT admissions.subject_id, microbiologyevents.spec_type_desc, microbiologyevents.charttime FROM microbiologyevents JOIN admissions ON microbiologyevents.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', microbiologyevents.charttime) <= '2104') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') GROUP BY t2.spec_type_desc) AS t3 WHERE t3.c1 <= 4

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 four most frequent specimen tests that patients had within the same month after having been diagnosed with 29-30 comp wks gestation until 2104? ### Input: CREATE TABLE d_icd_procedures (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE outputevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    value number
)

CREATE TABLE admissions (
    row_id number,
    subject_id number,
    hadm_id number,
    admittime time,
    dischtime time,
    admission_type text,
    admission_location text,
    discharge_location text,
    insurance text,
    language text,
    marital_status text,
    ethnicity text,
    age number
)

CREATE TABLE d_icd_diagnoses (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE icustays (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    first_careunit text,
    last_careunit text,
    first_wardid number,
    last_wardid number,
    intime time,
    outtime time
)

CREATE TABLE procedures_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

CREATE TABLE transfers (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    eventtype text,
    careunit text,
    wardid number,
    intime time,
    outtime time
)

CREATE TABLE d_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 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 chartevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

CREATE TABLE cost (
    row_id number,
    subject_id number,
    hadm_id number,
    event_type text,
    event_id number,
    chargetime time,
    cost number
)

CREATE TABLE diagnoses_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

CREATE TABLE microbiologyevents (
    row_id number,
    subject_id number,
    hadm_id number,
    charttime time,
    spec_type_desc text,
    org_name text
)

CREATE TABLE prescriptions (
    row_id number,
    subject_id number,
    hadm_id number,
    startdate time,
    enddate time,
    drug text,
    dose_val_rx text,
    dose_unit_rx text,
    route text
)

CREATE TABLE labevents (
    row_id number,
    subject_id number,
    hadm_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
) ### Response: SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = '29-30 comp wks gestation') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2104') AS t1 JOIN (SELECT admissions.subject_id, microbiologyevents.spec_type_desc, microbiologyevents.charttime FROM microbiologyevents JOIN admissions ON microbiologyevents.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', microbiologyevents.charttime) <= '2104') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') GROUP BY t2.spec_type_desc) AS t3 WHERE t3.c1 <= 4


Instruction: Who was the director of the movie having a release date of 1934-09-15, an MM Series and a production number less than 6494?

Input:
CREATE TABLE table_name_12 (
    director VARCHAR,
    release_date VARCHAR,
    series VARCHAR,
    production_num VARCHAR
)

Response: SELECT director FROM table_name_12 WHERE series = "mm" AND production_num < 6494 AND release_date = "1934-09-15"

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 director of the movie having a release date of 1934-09-15, an MM Series and a production number less than 6494? ### Input: CREATE TABLE table_name_12 (
    director VARCHAR,
    release_date VARCHAR,
    series VARCHAR,
    production_num VARCHAR
) ### Response: SELECT director FROM table_name_12 WHERE series = "mm" AND production_num < 6494 AND release_date = "1934-09-15"


Instruction: Which Pick # is the highest one that has a Name of william middleton, and a Round larger than 5?

Input:
CREATE TABLE table_name_32 (
    pick__number INTEGER,
    name VARCHAR,
    round VARCHAR
)

Response: SELECT MAX(pick__number) FROM table_name_32 WHERE name = "william middleton" AND round > 5

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 Pick # is the highest one that has a Name of william middleton, and a Round larger than 5? ### Input: CREATE TABLE table_name_32 (
    pick__number INTEGER,
    name VARCHAR,
    round VARCHAR
) ### Response: SELECT MAX(pick__number) FROM table_name_32 WHERE name = "william middleton" AND round > 5


Instruction: count the number of patients who have had a remove fb from periton procedure performed two or more times since 2104.

Input:
CREATE TABLE microbiologyevents (
    row_id number,
    subject_id number,
    hadm_id number,
    charttime time,
    spec_type_desc text,
    org_name text
)

CREATE TABLE labevents (
    row_id number,
    subject_id number,
    hadm_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

CREATE TABLE chartevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

CREATE TABLE 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 inputevents_cv (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    amount number
)

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_labitems (
    row_id number,
    itemid number,
    label text
)

CREATE TABLE d_items (
    row_id number,
    itemid number,
    label text,
    linksto 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 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_diagnoses (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE d_icd_procedures (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE icustays (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    first_careunit text,
    last_careunit text,
    first_wardid number,
    last_wardid number,
    intime time,
    outtime time
)

CREATE TABLE cost (
    row_id number,
    subject_id number,
    hadm_id number,
    event_type text,
    event_id number,
    chargetime time,
    cost number
)

CREATE TABLE outputevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    value number
)

CREATE TABLE patients (
    row_id number,
    subject_id number,
    gender text,
    dob time,
    dod time
)

Response: SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'remove fb from periton') AND STRFTIME('%y', procedures_icd.charttime) >= '2104' GROUP BY admissions.subject_id) AS t1 WHERE t1.c1 >= 2

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 a remove fb from periton procedure performed two or more times since 2104. ### Input: CREATE TABLE microbiologyevents (
    row_id number,
    subject_id number,
    hadm_id number,
    charttime time,
    spec_type_desc text,
    org_name text
)

CREATE TABLE labevents (
    row_id number,
    subject_id number,
    hadm_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

CREATE TABLE chartevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

CREATE TABLE 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 inputevents_cv (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    amount number
)

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_labitems (
    row_id number,
    itemid number,
    label text
)

CREATE TABLE d_items (
    row_id number,
    itemid number,
    label text,
    linksto 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 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_diagnoses (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE d_icd_procedures (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE icustays (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    first_careunit text,
    last_careunit text,
    first_wardid number,
    last_wardid number,
    intime time,
    outtime time
)

CREATE TABLE cost (
    row_id number,
    subject_id number,
    hadm_id number,
    event_type text,
    event_id number,
    chargetime time,
    cost number
)

CREATE TABLE outputevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    value number
)

CREATE TABLE patients (
    row_id number,
    subject_id number,
    gender text,
    dob time,
    dod time
) ### Response: SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'remove fb from periton') AND STRFTIME('%y', procedures_icd.charttime) >= '2104' GROUP BY admissions.subject_id) AS t1 WHERE t1.c1 >= 2


Instruction: Which Fictional narrator has a Published as serial of february july 1912, all-story?

Input:
CREATE TABLE table_14163 (
    "Order" real,
    "Published as serial" text,
    "Published as novel" text,
    "Fictional narrator" text,
    "Year in novel" text
)

Response: SELECT "Fictional narrator" FROM table_14163 WHERE "Published as serial" = 'february–july 1912, all-story'

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 Fictional narrator has a Published as serial of february july 1912, all-story? ### Input: CREATE TABLE table_14163 (
    "Order" real,
    "Published as serial" text,
    "Published as novel" text,
    "Fictional narrator" text,
    "Year in novel" text
) ### Response: SELECT "Fictional narrator" FROM table_14163 WHERE "Published as serial" = 'february–july 1912, all-story'


Instruction: Would EEB 412 qualify for ULCS ?

Input:
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
)

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 program_course (
    program_id int,
    course_id int,
    workload int,
    category varchar
)

CREATE TABLE comment_instructor (
    instructor_id int,
    student_id int,
    score int,
    comment_text 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 program (
    program_id int,
    name varchar,
    college varchar,
    introduction varchar
)

CREATE TABLE requirement (
    requirement_id int,
    requirement varchar,
    college varchar
)

CREATE TABLE gsi (
    course_offering_id int,
    student_id int
)

CREATE TABLE program_requirement (
    program_id int,
    category varchar,
    min_credit int,
    additional_req varchar
)

CREATE TABLE course_prerequisite (
    pre_course_id int,
    course_id int
)

CREATE TABLE jobs (
    job_id int,
    job_title varchar,
    description varchar,
    requirement varchar,
    city varchar,
    state varchar,
    country varchar,
    zip int
)

CREATE TABLE offering_instructor (
    offering_instructor_id int,
    offering_id int,
    instructor_id int
)

CREATE TABLE ta (
    campus_job_id int,
    student_id int,
    location varchar
)

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 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 semester (
    semester_id int,
    semester varchar,
    year int
)

CREATE TABLE area (
    course_id int,
    area varchar
)

CREATE TABLE instructor (
    instructor_id int,
    name varchar,
    uniqname varchar
)

Response: SELECT COUNT(*) > 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'EEB' AND course.number = 412 AND program_course.category LIKE '%ULCS%'

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: Would EEB 412 qualify for ULCS ? ### Input: 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
)

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 program_course (
    program_id int,
    course_id int,
    workload int,
    category varchar
)

CREATE TABLE comment_instructor (
    instructor_id int,
    student_id int,
    score int,
    comment_text 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 program (
    program_id int,
    name varchar,
    college varchar,
    introduction varchar
)

CREATE TABLE requirement (
    requirement_id int,
    requirement varchar,
    college varchar
)

CREATE TABLE gsi (
    course_offering_id int,
    student_id int
)

CREATE TABLE program_requirement (
    program_id int,
    category varchar,
    min_credit int,
    additional_req varchar
)

CREATE TABLE course_prerequisite (
    pre_course_id int,
    course_id int
)

CREATE TABLE jobs (
    job_id int,
    job_title varchar,
    description varchar,
    requirement varchar,
    city varchar,
    state varchar,
    country varchar,
    zip int
)

CREATE TABLE offering_instructor (
    offering_instructor_id int,
    offering_id int,
    instructor_id int
)

CREATE TABLE ta (
    campus_job_id int,
    student_id int,
    location varchar
)

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 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 semester (
    semester_id int,
    semester varchar,
    year int
)

CREATE TABLE area (
    course_id int,
    area varchar
)

CREATE TABLE instructor (
    instructor_id int,
    name varchar,
    uniqname varchar
) ### Response: SELECT COUNT(*) > 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'EEB' AND course.number = 412 AND program_course.category LIKE '%ULCS%'


Instruction: Which time/retired has a qual of 144.02?

Input:
CREATE TABLE table_name_75 (
    time_retired VARCHAR,
    qual VARCHAR
)

Response: SELECT time_retired FROM table_name_75 WHERE qual = 144.02

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 time/retired has a qual of 144.02? ### Input: CREATE TABLE table_name_75 (
    time_retired VARCHAR,
    qual VARCHAR
) ### Response: SELECT time_retired FROM table_name_75 WHERE qual = 144.02


Instruction: did patient 030-6441 have a wound care procedure at other hospitals?

Input:
CREATE TABLE treatment (
    treatmentid number,
    patientunitstayid number,
    treatmentname text,
    treatmenttime time
)

CREATE TABLE cost (
    costid number,
    uniquepid text,
    patienthealthsystemstayid number,
    eventtype text,
    eventid number,
    chargetime time,
    cost number
)

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 medication (
    medicationid number,
    patientunitstayid number,
    drugname text,
    dosage text,
    routeadmin text,
    drugstarttime time,
    drugstoptime time
)

CREATE TABLE microlab (
    microlabid number,
    patientunitstayid number,
    culturesite text,
    organism text,
    culturetakentime time
)

CREATE TABLE 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 diagnosis (
    diagnosisid number,
    patientunitstayid number,
    diagnosisname text,
    diagnosistime time,
    icd9code text
)

CREATE TABLE vitalperiodic (
    vitalperiodicid number,
    patientunitstayid number,
    temperature number,
    sao2 number,
    heartrate number,
    respiration number,
    systemicsystolic number,
    systemicdiastolic number,
    systemicmean number,
    observationtime time
)

CREATE TABLE allergy (
    allergyid number,
    patientunitstayid number,
    drugname text,
    allergyname text,
    allergytime time
)

Response: SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '030-6441' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '030-6441' AND patient.hospitaldischargetime IS NULL)) AND treatment.treatmentname = 'wound care'

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: did patient 030-6441 have a wound care procedure at other hospitals? ### Input: CREATE TABLE treatment (
    treatmentid number,
    patientunitstayid number,
    treatmentname text,
    treatmenttime time
)

CREATE TABLE cost (
    costid number,
    uniquepid text,
    patienthealthsystemstayid number,
    eventtype text,
    eventid number,
    chargetime time,
    cost number
)

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 medication (
    medicationid number,
    patientunitstayid number,
    drugname text,
    dosage text,
    routeadmin text,
    drugstarttime time,
    drugstoptime time
)

CREATE TABLE microlab (
    microlabid number,
    patientunitstayid number,
    culturesite text,
    organism text,
    culturetakentime time
)

CREATE TABLE 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 diagnosis (
    diagnosisid number,
    patientunitstayid number,
    diagnosisname text,
    diagnosistime time,
    icd9code text
)

CREATE TABLE vitalperiodic (
    vitalperiodicid number,
    patientunitstayid number,
    temperature number,
    sao2 number,
    heartrate number,
    respiration number,
    systemicsystolic number,
    systemicdiastolic number,
    systemicmean number,
    observationtime time
)

CREATE TABLE allergy (
    allergyid number,
    patientunitstayid number,
    drugname text,
    allergyname text,
    allergytime time
) ### Response: SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '030-6441' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '030-6441' AND patient.hospitaldischargetime IS NULL)) AND treatment.treatmentname = 'wound care'


Instruction: count the number of patients who until 4 years ago have been prescribed acd-a for crrt.

Input:
CREATE TABLE prescriptions (
    row_id number,
    subject_id number,
    hadm_id number,
    startdate time,
    enddate time,
    drug text,
    dose_val_rx text,
    dose_unit_rx text,
    route text
)

CREATE TABLE labevents (
    row_id number,
    subject_id number,
    hadm_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

CREATE TABLE cost (
    row_id number,
    subject_id number,
    hadm_id number,
    event_type text,
    event_id number,
    chargetime time,
    cost number
)

CREATE TABLE admissions (
    row_id number,
    subject_id number,
    hadm_id number,
    admittime time,
    dischtime time,
    admission_type text,
    admission_location text,
    discharge_location text,
    insurance text,
    language text,
    marital_status text,
    ethnicity text,
    age number
)

CREATE TABLE outputevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    value number
)

CREATE TABLE transfers (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    eventtype text,
    careunit text,
    wardid number,
    intime time,
    outtime time
)

CREATE TABLE d_labitems (
    row_id number,
    itemid number,
    label text
)

CREATE TABLE d_icd_diagnoses (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE procedures_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

CREATE TABLE patients (
    row_id number,
    subject_id number,
    gender text,
    dob time,
    dod time
)

CREATE TABLE chartevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

CREATE TABLE d_items (
    row_id number,
    itemid number,
    label text,
    linksto 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 diagnoses_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

CREATE TABLE microbiologyevents (
    row_id number,
    subject_id number,
    hadm_id number,
    charttime time,
    spec_type_desc text,
    org_name text
)

CREATE TABLE 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_icd_procedures (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

Response: SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'acd-a for crrt' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year'))

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 until 4 years ago have been prescribed acd-a for crrt. ### Input: CREATE TABLE prescriptions (
    row_id number,
    subject_id number,
    hadm_id number,
    startdate time,
    enddate time,
    drug text,
    dose_val_rx text,
    dose_unit_rx text,
    route text
)

CREATE TABLE labevents (
    row_id number,
    subject_id number,
    hadm_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

CREATE TABLE cost (
    row_id number,
    subject_id number,
    hadm_id number,
    event_type text,
    event_id number,
    chargetime time,
    cost number
)

CREATE TABLE admissions (
    row_id number,
    subject_id number,
    hadm_id number,
    admittime time,
    dischtime time,
    admission_type text,
    admission_location text,
    discharge_location text,
    insurance text,
    language text,
    marital_status text,
    ethnicity text,
    age number
)

CREATE TABLE outputevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    value number
)

CREATE TABLE transfers (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    eventtype text,
    careunit text,
    wardid number,
    intime time,
    outtime time
)

CREATE TABLE d_labitems (
    row_id number,
    itemid number,
    label text
)

CREATE TABLE d_icd_diagnoses (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE procedures_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

CREATE TABLE patients (
    row_id number,
    subject_id number,
    gender text,
    dob time,
    dod time
)

CREATE TABLE chartevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

CREATE TABLE d_items (
    row_id number,
    itemid number,
    label text,
    linksto 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 diagnoses_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

CREATE TABLE microbiologyevents (
    row_id number,
    subject_id number,
    hadm_id number,
    charttime time,
    spec_type_desc text,
    org_name text
)

CREATE TABLE 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_icd_procedures (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
) ### Response: SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'acd-a for crrt' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year'))


Instruction: In season is 2008 09, how many wins did they have?

Input:
CREATE TABLE table_23959 (
    "Season" text,
    "GP" real,
    "W (OT/SO)" text,
    "L (OT/SO)" text,
    "Pts" real,
    "Pts/GP" text,
    "GF \u2013 GA" text,
    "Rank (league/conference)" text,
    "Top Scorer" text
)

Response: SELECT "W (OT/SO)" FROM table_23959 WHERE "Season" = '2008–09'

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 season is 2008 09, how many wins did they have? ### Input: CREATE TABLE table_23959 (
    "Season" text,
    "GP" real,
    "W (OT/SO)" text,
    "L (OT/SO)" text,
    "Pts" real,
    "Pts/GP" text,
    "GF \u2013 GA" text,
    "Rank (league/conference)" text,
    "Top Scorer" text
) ### Response: SELECT "W (OT/SO)" FROM table_23959 WHERE "Season" = '2008–09'


Instruction: How many people scored the most points during the game on December 10?

Input:
CREATE TABLE table_27756014_6 (
    high_points VARCHAR,
    date VARCHAR
)

Response: SELECT COUNT(high_points) FROM table_27756014_6 WHERE date = "December 10"

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 people scored the most points during the game on December 10? ### Input: CREATE TABLE table_27756014_6 (
    high_points VARCHAR,
    date VARCHAR
) ### Response: SELECT COUNT(high_points) FROM table_27756014_6 WHERE date = "December 10"


Instruction: For the match with a home team score of 11.14 (80), what was the venue?

Input:
CREATE TABLE table_33317 (
    "Home team" text,
    "Home team score" text,
    "Away team" text,
    "Away team score" text,
    "Venue" text,
    "Crowd" real,
    "Date" text
)

Response: SELECT "Venue" FROM table_33317 WHERE "Home team score" = '11.14 (80)'

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 the match with a home team score of 11.14 (80), what was the venue? ### Input: CREATE TABLE table_33317 (
    "Home team" text,
    "Home team score" text,
    "Away team" text,
    "Away team score" text,
    "Venue" text,
    "Crowd" real,
    "Date" text
) ### Response: SELECT "Venue" FROM table_33317 WHERE "Home team score" = '11.14 (80)'


Instruction: How many positions are there for RB1 Motorsports?

Input:
CREATE TABLE table_3588 (
    "Year" real,
    "Starts" real,
    "Wins" real,
    "Top 10" real,
    "Avg. Start" text,
    "Avg. Finish" text,
    "Winnings" text,
    "Position" text,
    "Team(s)" text
)

Response: SELECT COUNT("Position") FROM table_3588 WHERE "Team(s)" = 'RB1 Motorsports'

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 positions are there for RB1 Motorsports? ### Input: CREATE TABLE table_3588 (
    "Year" real,
    "Starts" real,
    "Wins" real,
    "Top 10" real,
    "Avg. Start" text,
    "Avg. Finish" text,
    "Winnings" text,
    "Position" text,
    "Team(s)" text
) ### Response: SELECT COUNT("Position") FROM table_3588 WHERE "Team(s)" = 'RB1 Motorsports'


Instruction: what is minimum days of hospital stay of patients whose age is greater than or equal to 41?

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 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 procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

Response: SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.age >= "41"

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 minimum days of hospital stay of patients whose age is greater than or equal to 41? ### 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 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 procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
) ### Response: SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.age >= "41"


Instruction: Who is every high points for the Pistons team?

Input:
CREATE TABLE table_23248910_9 (
    high_points VARCHAR,
    team VARCHAR
)

Response: SELECT high_points FROM table_23248910_9 WHERE team = "Pistons"

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 every high points for the Pistons team? ### Input: CREATE TABLE table_23248910_9 (
    high_points VARCHAR,
    team VARCHAR
) ### Response: SELECT high_points FROM table_23248910_9 WHERE team = "Pistons"


Instruction: what is the price for amylase, body fluid?

Input:
CREATE TABLE diagnoses_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

CREATE TABLE admissions (
    row_id number,
    subject_id number,
    hadm_id number,
    admittime time,
    dischtime time,
    admission_type text,
    admission_location text,
    discharge_location text,
    insurance text,
    language text,
    marital_status text,
    ethnicity text,
    age number
)

CREATE TABLE outputevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    value number
)

CREATE TABLE transfers (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    eventtype text,
    careunit text,
    wardid number,
    intime time,
    outtime time
)

CREATE TABLE microbiologyevents (
    row_id number,
    subject_id number,
    hadm_id number,
    charttime time,
    spec_type_desc text,
    org_name text
)

CREATE TABLE d_icd_procedures (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE procedures_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

CREATE TABLE icustays (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    first_careunit text,
    last_careunit text,
    first_wardid number,
    last_wardid number,
    intime time,
    outtime time
)

CREATE TABLE d_items (
    row_id number,
    itemid number,
    label text,
    linksto text
)

CREATE TABLE cost (
    row_id number,
    subject_id number,
    hadm_id number,
    event_type text,
    event_id number,
    chargetime time,
    cost number
)

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_labitems (
    row_id number,
    itemid number,
    label text
)

CREATE TABLE labevents (
    row_id number,
    subject_id number,
    hadm_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

CREATE TABLE d_icd_diagnoses (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE inputevents_cv (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    amount number
)

CREATE TABLE chartevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

CREATE TABLE patients (
    row_id number,
    subject_id number,
    gender text,
    dob time,
    dod time
)

Response: SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'amylase, body fluid'))

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 price for amylase, body fluid? ### Input: CREATE TABLE diagnoses_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

CREATE TABLE admissions (
    row_id number,
    subject_id number,
    hadm_id number,
    admittime time,
    dischtime time,
    admission_type text,
    admission_location text,
    discharge_location text,
    insurance text,
    language text,
    marital_status text,
    ethnicity text,
    age number
)

CREATE TABLE outputevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    value number
)

CREATE TABLE transfers (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    eventtype text,
    careunit text,
    wardid number,
    intime time,
    outtime time
)

CREATE TABLE microbiologyevents (
    row_id number,
    subject_id number,
    hadm_id number,
    charttime time,
    spec_type_desc text,
    org_name text
)

CREATE TABLE d_icd_procedures (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE procedures_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

CREATE TABLE icustays (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    first_careunit text,
    last_careunit text,
    first_wardid number,
    last_wardid number,
    intime time,
    outtime time
)

CREATE TABLE d_items (
    row_id number,
    itemid number,
    label text,
    linksto text
)

CREATE TABLE cost (
    row_id number,
    subject_id number,
    hadm_id number,
    event_type text,
    event_id number,
    chargetime time,
    cost number
)

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_labitems (
    row_id number,
    itemid number,
    label text
)

CREATE TABLE labevents (
    row_id number,
    subject_id number,
    hadm_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

CREATE TABLE d_icd_diagnoses (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE inputevents_cv (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    amount number
)

CREATE TABLE chartevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

CREATE TABLE patients (
    row_id number,
    subject_id number,
    gender text,
    dob time,
    dod time
) ### Response: SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'amylase, body fluid'))


Instruction: Frequency (MHz) that has a Type of primary, and a Call letters of ktbb-fm has what total number?

Input:
CREATE TABLE table_5631 (
    "Frequency (MHz)" real,
    "Call letters" text,
    "Licensed location" text,
    "Type" text,
    "Format" text
)

Response: SELECT COUNT("Frequency (MHz)") FROM table_5631 WHERE "Type" = 'primary' AND "Call letters" = 'ktbb-fm'

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: Frequency (MHz) that has a Type of primary, and a Call letters of ktbb-fm has what total number? ### Input: CREATE TABLE table_5631 (
    "Frequency (MHz)" real,
    "Call letters" text,
    "Licensed location" text,
    "Type" text,
    "Format" text
) ### Response: SELECT COUNT("Frequency (MHz)") FROM table_5631 WHERE "Type" = 'primary' AND "Call letters" = 'ktbb-fm'


Instruction: A bar chart shows the distribution of All_Home and the amount of All_Home , and group by attribute All_Home, and sort by the x axis from high to low.

Input:
CREATE TABLE basketball_match (
    Team_ID int,
    School_ID int,
    Team_Name text,
    ACC_Regular_Season text,
    ACC_Percent text,
    ACC_Home text,
    ACC_Road text,
    All_Games text,
    All_Games_Percent int,
    All_Home text,
    All_Road text,
    All_Neutral text
)

CREATE TABLE university (
    School_ID int,
    School text,
    Location text,
    Founded real,
    Affiliation text,
    Enrollment real,
    Nickname text,
    Primary_conference text
)

Response: SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC

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 shows the distribution of All_Home and the amount of All_Home , and group by attribute All_Home, and sort by the x axis from high to low. ### Input: CREATE TABLE basketball_match (
    Team_ID int,
    School_ID int,
    Team_Name text,
    ACC_Regular_Season text,
    ACC_Percent text,
    ACC_Home text,
    ACC_Road text,
    All_Games text,
    All_Games_Percent int,
    All_Home text,
    All_Road text,
    All_Neutral text
)

CREATE TABLE university (
    School_ID int,
    School text,
    Location text,
    Founded real,
    Affiliation text,
    Enrollment real,
    Nickname text,
    Primary_conference text
) ### Response: SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC


Instruction: How many types of valves were used on this engine that was built on 1902-05?

Input:
CREATE TABLE table_25695027_1 (
    valves VARCHAR,
    years_built VARCHAR
)

Response: SELECT COUNT(valves) FROM table_25695027_1 WHERE years_built = "1902-05"

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 types of valves were used on this engine that was built on 1902-05? ### Input: CREATE TABLE table_25695027_1 (
    valves VARCHAR,
    years_built VARCHAR
) ### Response: SELECT COUNT(valves) FROM table_25695027_1 WHERE years_built = "1902-05"


Instruction: Who won with the fastest lap of daijiro hiura on March 29?

Input:
CREATE TABLE table_name_97 (
    race_winner VARCHAR,
    fastest_lap VARCHAR,
    date VARCHAR
)

Response: SELECT race_winner FROM table_name_97 WHERE fastest_lap = "daijiro hiura" AND date = "march 29"

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 won with the fastest lap of daijiro hiura on March 29? ### Input: CREATE TABLE table_name_97 (
    race_winner VARCHAR,
    fastest_lap VARCHAR,
    date VARCHAR
) ### Response: SELECT race_winner FROM table_name_97 WHERE fastest_lap = "daijiro hiura" AND date = "march 29"


Instruction: since 2100 what are the five most frequently ordered lab tests for patients 40s?

Input:
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 lab (
    labid number,
    patientunitstayid number,
    labname text,
    labresult number,
    labresulttime time
)

CREATE TABLE vitalperiodic (
    vitalperiodicid number,
    patientunitstayid number,
    temperature number,
    sao2 number,
    heartrate number,
    respiration number,
    systemicsystolic number,
    systemicdiastolic number,
    systemicmean number,
    observationtime time
)

CREATE TABLE cost (
    costid number,
    uniquepid text,
    patienthealthsystemstayid number,
    eventtype text,
    eventid number,
    chargetime time,
    cost number
)

CREATE TABLE medication (
    medicationid number,
    patientunitstayid number,
    drugname text,
    dosage text,
    routeadmin text,
    drugstarttime time,
    drugstoptime time
)

CREATE TABLE intakeoutput (
    intakeoutputid number,
    patientunitstayid number,
    cellpath text,
    celllabel text,
    cellvaluenumeric number,
    intakeoutputtime time
)

CREATE TABLE patient (
    uniquepid text,
    patienthealthsystemstayid number,
    patientunitstayid number,
    gender text,
    age text,
    ethnicity text,
    hospitalid number,
    wardid number,
    admissionheight number,
    admissionweight number,
    dischargeweight number,
    hospitaladmittime time,
    hospitaladmitsource text,
    unitadmittime time,
    unitdischargetime time,
    hospitaldischargetime time,
    hospitaldischargestatus text
)

CREATE TABLE allergy (
    allergyid number,
    patientunitstayid number,
    drugname text,
    allergyname text,
    allergytime time
)

CREATE TABLE treatment (
    treatmentid number,
    patientunitstayid number,
    treatmentname text,
    treatmenttime time
)

Response: SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND STRFTIME('%y', lab.labresulttime) >= '2100' GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 5

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: since 2100 what are the five most frequently ordered lab tests for patients 40s? ### Input: 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 lab (
    labid number,
    patientunitstayid number,
    labname text,
    labresult number,
    labresulttime time
)

CREATE TABLE vitalperiodic (
    vitalperiodicid number,
    patientunitstayid number,
    temperature number,
    sao2 number,
    heartrate number,
    respiration number,
    systemicsystolic number,
    systemicdiastolic number,
    systemicmean number,
    observationtime time
)

CREATE TABLE cost (
    costid number,
    uniquepid text,
    patienthealthsystemstayid number,
    eventtype text,
    eventid number,
    chargetime time,
    cost number
)

CREATE TABLE medication (
    medicationid number,
    patientunitstayid number,
    drugname text,
    dosage text,
    routeadmin text,
    drugstarttime time,
    drugstoptime time
)

CREATE TABLE intakeoutput (
    intakeoutputid number,
    patientunitstayid number,
    cellpath text,
    celllabel text,
    cellvaluenumeric number,
    intakeoutputtime time
)

CREATE TABLE patient (
    uniquepid text,
    patienthealthsystemstayid number,
    patientunitstayid number,
    gender text,
    age text,
    ethnicity text,
    hospitalid number,
    wardid number,
    admissionheight number,
    admissionweight number,
    dischargeweight number,
    hospitaladmittime time,
    hospitaladmitsource text,
    unitadmittime time,
    unitdischargetime time,
    hospitaldischargetime time,
    hospitaldischargestatus text
)

CREATE TABLE allergy (
    allergyid number,
    patientunitstayid number,
    drugname text,
    allergyname text,
    allergytime time
)

CREATE TABLE treatment (
    treatmentid number,
    patientunitstayid number,
    treatmentname text,
    treatmenttime time
) ### Response: SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND STRFTIME('%y', lab.labresulttime) >= '2100' GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 5


Instruction: What is the Elevation (m) of the Peak with a Prominence (m) larger than 2,143 and Col (m) of 2012?

Input:
CREATE TABLE table_79478 (
    "Peak" text,
    "Country" text,
    "Elevation (m)" real,
    "Prominence (m)" real,
    "Col (m)" real
)

Response: SELECT "Elevation (m)" FROM table_79478 WHERE "Prominence (m)" > '2,143' AND "Col (m)" = '2012'

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 Elevation (m) of the Peak with a Prominence (m) larger than 2,143 and Col (m) of 2012? ### Input: CREATE TABLE table_79478 (
    "Peak" text,
    "Country" text,
    "Elevation (m)" real,
    "Prominence (m)" real,
    "Col (m)" real
) ### Response: SELECT "Elevation (m)" FROM table_79478 WHERE "Prominence (m)" > '2,143' AND "Col (m)" = '2012'


Instruction: What is the country of the airport with the highest elevation?

Input:
CREATE TABLE airlines (
    alid number,
    name text,
    iata text,
    icao text,
    callsign text,
    country text,
    active text
)

CREATE TABLE airports (
    apid number,
    name text,
    city text,
    country text,
    x number,
    y number,
    elevation number,
    iata text,
    icao text
)

CREATE TABLE routes (
    rid number,
    dst_apid number,
    dst_ap text,
    src_apid number,
    src_ap text,
    alid number,
    airline text,
    codeshare text
)

Response: SELECT country FROM airports ORDER BY elevation DESC LIMIT 1

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 country of the airport with the highest elevation? ### Input: CREATE TABLE airlines (
    alid number,
    name text,
    iata text,
    icao text,
    callsign text,
    country text,
    active text
)

CREATE TABLE airports (
    apid number,
    name text,
    city text,
    country text,
    x number,
    y number,
    elevation number,
    iata text,
    icao text
)

CREATE TABLE routes (
    rid number,
    dst_apid number,
    dst_ap text,
    src_apid number,
    src_ap text,
    alid number,
    airline text,
    codeshare text
) ### Response: SELECT country FROM airports ORDER BY elevation DESC LIMIT 1


Instruction: What was the losing bonus that had 1 draw and a 10 try bonus?

Input:
CREATE TABLE table_name_51 (
    losing_bonus VARCHAR,
    drawn VARCHAR,
    try_bonus VARCHAR
)

Response: SELECT losing_bonus FROM table_name_51 WHERE drawn = "1" AND try_bonus = "10"

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 losing bonus that had 1 draw and a 10 try bonus? ### Input: CREATE TABLE table_name_51 (
    losing_bonus VARCHAR,
    drawn VARCHAR,
    try_bonus VARCHAR
) ### Response: SELECT losing_bonus FROM table_name_51 WHERE drawn = "1" AND try_bonus = "10"


Instruction: List the first name and last name of customers have the amount of outstanding between 1000 and 3000.

Input:
CREATE TABLE addresses (
    address_id number,
    line_1_number_building text,
    city text,
    zip_postcode text,
    state_province_county text,
    country text
)

CREATE TABLE vehicles (
    vehicle_id number,
    vehicle_details text
)

CREATE TABLE lessons (
    lesson_id number,
    customer_id number,
    lesson_status_code text,
    staff_id number,
    vehicle_id number,
    lesson_date time,
    lesson_time text,
    price number
)

CREATE TABLE customers (
    customer_id number,
    customer_address_id number,
    customer_status_code text,
    date_became_customer time,
    date_of_birth time,
    first_name text,
    last_name text,
    amount_outstanding number,
    email_address text,
    phone_number text,
    cell_mobile_phone_number text
)

CREATE TABLE staff (
    staff_id number,
    staff_address_id number,
    nickname text,
    first_name text,
    middle_name text,
    last_name text,
    date_of_birth time,
    date_joined_staff time,
    date_left_staff time
)

CREATE TABLE customer_payments (
    customer_id number,
    datetime_payment time,
    payment_method_code text,
    amount_payment number
)

Response: SELECT first_name, last_name FROM customers WHERE amount_outstanding BETWEEN 1000 AND 3000

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 the first name and last name of customers have the amount of outstanding between 1000 and 3000. ### Input: CREATE TABLE addresses (
    address_id number,
    line_1_number_building text,
    city text,
    zip_postcode text,
    state_province_county text,
    country text
)

CREATE TABLE vehicles (
    vehicle_id number,
    vehicle_details text
)

CREATE TABLE lessons (
    lesson_id number,
    customer_id number,
    lesson_status_code text,
    staff_id number,
    vehicle_id number,
    lesson_date time,
    lesson_time text,
    price number
)

CREATE TABLE customers (
    customer_id number,
    customer_address_id number,
    customer_status_code text,
    date_became_customer time,
    date_of_birth time,
    first_name text,
    last_name text,
    amount_outstanding number,
    email_address text,
    phone_number text,
    cell_mobile_phone_number text
)

CREATE TABLE staff (
    staff_id number,
    staff_address_id number,
    nickname text,
    first_name text,
    middle_name text,
    last_name text,
    date_of_birth time,
    date_joined_staff time,
    date_left_staff time
)

CREATE TABLE customer_payments (
    customer_id number,
    datetime_payment time,
    payment_method_code text,
    amount_payment number
) ### Response: SELECT first_name, last_name FROM customers WHERE amount_outstanding BETWEEN 1000 AND 3000


Instruction: What shuttle Run (sec) time has a 2.4km Run (min:sec) of 12:21-13:00?

Input:
CREATE TABLE table_56767 (
    "Grade" text,
    "Points" real,
    "Sit-up (reps)" text,
    "Standing Broad Jump (cm)" text,
    "Chin-up (reps)" text,
    "Shuttle Run (sec)" text,
    "2.4km Run (min:sec)" text
)

Response: SELECT "Shuttle Run (sec)" FROM table_56767 WHERE "2.4km Run (min:sec)" = '12:21-13:00'

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 shuttle Run (sec) time has a 2.4km Run (min:sec) of 12:21-13:00? ### Input: CREATE TABLE table_56767 (
    "Grade" text,
    "Points" real,
    "Sit-up (reps)" text,
    "Standing Broad Jump (cm)" text,
    "Chin-up (reps)" text,
    "Shuttle Run (sec)" text,
    "2.4km Run (min:sec)" text
) ### Response: SELECT "Shuttle Run (sec)" FROM table_56767 WHERE "2.4km Run (min:sec)" = '12:21-13:00'


Instruction: Which highest Round has a Result of loss?

Input:
CREATE TABLE table_name_27 (
    round INTEGER,
    result VARCHAR
)

Response: SELECT MAX(round) FROM table_name_27 WHERE result = "loss"

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 highest Round has a Result of loss? ### Input: CREATE TABLE table_name_27 (
    round INTEGER,
    result VARCHAR
) ### Response: SELECT MAX(round) FROM table_name_27 WHERE result = "loss"


Instruction: Name the publication date when the fictional date is 2112

Input:
CREATE TABLE table_name_25 (
    publication_date VARCHAR,
    fictional_date VARCHAR
)

Response: SELECT publication_date FROM table_name_25 WHERE fictional_date = "2112"

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 publication date when the fictional date is 2112 ### Input: CREATE TABLE table_name_25 (
    publication_date VARCHAR,
    fictional_date VARCHAR
) ### Response: SELECT publication_date FROM table_name_25 WHERE fictional_date = "2112"


Instruction: What township is 28.597 square miles of land?

Input:
CREATE TABLE table_22466 (
    "Township" text,
    "County" text,
    "Pop. (2010)" real,
    "Land ( sqmi )" text,
    "Water (sqmi)" text,
    "Latitude" text,
    "Longitude" text,
    "GEO ID" real,
    "ANSI code" real
)

Response: SELECT "Township" FROM table_22466 WHERE "Land ( sqmi )" = '28.597'

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 township is 28.597 square miles of land? ### Input: CREATE TABLE table_22466 (
    "Township" text,
    "County" text,
    "Pop. (2010)" real,
    "Land ( sqmi )" text,
    "Water (sqmi)" text,
    "Latitude" text,
    "Longitude" text,
    "GEO ID" real,
    "ANSI code" real
) ### Response: SELECT "Township" FROM table_22466 WHERE "Land ( sqmi )" = '28.597'


Instruction: For those employees who did not have any job in the past, a bar chart shows the distribution of job_id and the sum of employee_id , and group by attribute job_id, and display from low to high by the sum employee id.

Input:
CREATE TABLE job_history (
    EMPLOYEE_ID decimal(6,0),
    START_DATE date,
    END_DATE date,
    JOB_ID varchar(10),
    DEPARTMENT_ID decimal(4,0)
)

CREATE TABLE countries (
    COUNTRY_ID varchar(2),
    COUNTRY_NAME varchar(40),
    REGION_ID decimal(10,0)
)

CREATE TABLE employees (
    EMPLOYEE_ID decimal(6,0),
    FIRST_NAME varchar(20),
    LAST_NAME varchar(25),
    EMAIL varchar(25),
    PHONE_NUMBER varchar(20),
    HIRE_DATE date,
    JOB_ID varchar(10),
    SALARY decimal(8,2),
    COMMISSION_PCT decimal(2,2),
    MANAGER_ID decimal(6,0),
    DEPARTMENT_ID decimal(4,0)
)

CREATE TABLE 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 regions (
    REGION_ID decimal(5,0),
    REGION_NAME varchar(25)
)

CREATE TABLE jobs (
    JOB_ID varchar(10),
    JOB_TITLE varchar(35),
    MIN_SALARY decimal(6,0),
    MAX_SALARY decimal(6,0)
)

Response: SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID)

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 did not have any job in the past, a bar chart shows the distribution of job_id and the sum of employee_id , and group by attribute job_id, and display from low to high by the sum employee id. ### Input: CREATE TABLE job_history (
    EMPLOYEE_ID decimal(6,0),
    START_DATE date,
    END_DATE date,
    JOB_ID varchar(10),
    DEPARTMENT_ID decimal(4,0)
)

CREATE TABLE countries (
    COUNTRY_ID varchar(2),
    COUNTRY_NAME varchar(40),
    REGION_ID decimal(10,0)
)

CREATE TABLE employees (
    EMPLOYEE_ID decimal(6,0),
    FIRST_NAME varchar(20),
    LAST_NAME varchar(25),
    EMAIL varchar(25),
    PHONE_NUMBER varchar(20),
    HIRE_DATE date,
    JOB_ID varchar(10),
    SALARY decimal(8,2),
    COMMISSION_PCT decimal(2,2),
    MANAGER_ID decimal(6,0),
    DEPARTMENT_ID decimal(4,0)
)

CREATE TABLE 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 regions (
    REGION_ID decimal(5,0),
    REGION_NAME varchar(25)
)

CREATE TABLE jobs (
    JOB_ID varchar(10),
    JOB_TITLE varchar(35),
    MIN_SALARY decimal(6,0),
    MAX_SALARY decimal(6,0)
) ### Response: SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID)


Instruction: What is the lowest number of laps obtained by driver Nick Heidfeld?

Input:
CREATE TABLE table_name_32 (
    laps INTEGER,
    driver VARCHAR
)

Response: SELECT MIN(laps) FROM table_name_32 WHERE driver = "nick heidfeld"

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 number of laps obtained by driver Nick Heidfeld? ### Input: CREATE TABLE table_name_32 (
    laps INTEGER,
    driver VARCHAR
) ### Response: SELECT MIN(laps) FROM table_name_32 WHERE driver = "nick heidfeld"


Instruction: Show the name of each county along with the corresponding number of delegates from that county.

Input:
CREATE TABLE county (
    County_Id int,
    County_name text,
    Population real,
    Zip_code text
)

CREATE TABLE party (
    Party_ID int,
    Year real,
    Party text,
    Governor text,
    Lieutenant_Governor text,
    Comptroller text,
    Attorney_General text,
    US_Senate text
)

CREATE TABLE election (
    Election_ID int,
    Counties_Represented text,
    District int,
    Delegate text,
    Party int,
    First_Elected real,
    Committee text
)

Response: SELECT County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY T1.County_Id

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 name of each county along with the corresponding number of delegates from that county. ### Input: CREATE TABLE county (
    County_Id int,
    County_name text,
    Population real,
    Zip_code text
)

CREATE TABLE party (
    Party_ID int,
    Year real,
    Party text,
    Governor text,
    Lieutenant_Governor text,
    Comptroller text,
    Attorney_General text,
    US_Senate text
)

CREATE TABLE election (
    Election_ID int,
    Counties_Represented text,
    District int,
    Delegate text,
    Party int,
    First_Elected real,
    Committee text
) ### Response: SELECT County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY T1.County_Id


Instruction: give me the top four most common diagnoses since 1 year ago.

Input:
CREATE TABLE microlab (
    microlabid number,
    patientunitstayid number,
    culturesite text,
    organism text,
    culturetakentime time
)

CREATE TABLE medication (
    medicationid number,
    patientunitstayid number,
    drugname text,
    dosage text,
    routeadmin text,
    drugstarttime time,
    drugstoptime time
)

CREATE TABLE cost (
    costid number,
    uniquepid text,
    patienthealthsystemstayid number,
    eventtype text,
    eventid number,
    chargetime time,
    cost number
)

CREATE TABLE 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
)

CREATE TABLE patient (
    uniquepid text,
    patienthealthsystemstayid number,
    patientunitstayid number,
    gender text,
    age text,
    ethnicity text,
    hospitalid number,
    wardid number,
    admissionheight number,
    admissionweight number,
    dischargeweight number,
    hospitaladmittime time,
    hospitaladmitsource text,
    unitadmittime time,
    unitdischargetime time,
    hospitaldischargetime time,
    hospitaldischargestatus text
)

CREATE TABLE treatment (
    treatmentid number,
    patientunitstayid number,
    treatmentname text,
    treatmenttime time
)

CREATE TABLE diagnosis (
    diagnosisid number,
    patientunitstayid number,
    diagnosisname text,
    diagnosistime time,
    icd9code text
)

CREATE TABLE lab (
    labid number,
    patientunitstayid number,
    labname text,
    labresult number,
    labresulttime time
)

CREATE TABLE vitalperiodic (
    vitalperiodicid number,
    patientunitstayid number,
    temperature number,
    sao2 number,
    heartrate number,
    respiration number,
    systemicsystolic number,
    systemicdiastolic number,
    systemicmean number,
    observationtime time
)

Response: SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4

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: give me the top four most common diagnoses since 1 year ago. ### Input: CREATE TABLE microlab (
    microlabid number,
    patientunitstayid number,
    culturesite text,
    organism text,
    culturetakentime time
)

CREATE TABLE medication (
    medicationid number,
    patientunitstayid number,
    drugname text,
    dosage text,
    routeadmin text,
    drugstarttime time,
    drugstoptime time
)

CREATE TABLE cost (
    costid number,
    uniquepid text,
    patienthealthsystemstayid number,
    eventtype text,
    eventid number,
    chargetime time,
    cost number
)

CREATE TABLE 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
)

CREATE TABLE patient (
    uniquepid text,
    patienthealthsystemstayid number,
    patientunitstayid number,
    gender text,
    age text,
    ethnicity text,
    hospitalid number,
    wardid number,
    admissionheight number,
    admissionweight number,
    dischargeweight number,
    hospitaladmittime time,
    hospitaladmitsource text,
    unitadmittime time,
    unitdischargetime time,
    hospitaldischargetime time,
    hospitaldischargestatus text
)

CREATE TABLE treatment (
    treatmentid number,
    patientunitstayid number,
    treatmentname text,
    treatmenttime time
)

CREATE TABLE diagnosis (
    diagnosisid number,
    patientunitstayid number,
    diagnosisname text,
    diagnosistime time,
    icd9code text
)

CREATE TABLE lab (
    labid number,
    patientunitstayid number,
    labname text,
    labresult number,
    labresulttime time
)

CREATE TABLE vitalperiodic (
    vitalperiodicid number,
    patientunitstayid number,
    temperature number,
    sao2 number,
    heartrate number,
    respiration number,
    systemicsystolic number,
    systemicdiastolic number,
    systemicmean number,
    observationtime time
) ### Response: SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4


Instruction: what is drug type of drug name cephalexin?

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 lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
)

CREATE TABLE procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE prescriptions (
    subject_id text,
    hadm_id text,
    icustay_id text,
    drug_type text,
    drug text,
    formulary_drug_cd text,
    route text,
    drug_dose text
)

CREATE TABLE diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

Response: SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Cephalexin"

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 drug type of drug name cephalexin? ### 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 lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
)

CREATE TABLE procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE prescriptions (
    subject_id text,
    hadm_id text,
    icustay_id text,
    drug_type text,
    drug text,
    formulary_drug_cd text,
    route text,
    drug_dose text
)

CREATE TABLE diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
) ### Response: SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Cephalexin"


Instruction: What is the career SR with a 1r in 1985?

Input:
CREATE TABLE table_name_43 (
    career_sr VARCHAR
)

Response: SELECT career_sr FROM table_name_43 WHERE 1985 = "1r"

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 career SR with a 1r in 1985? ### Input: CREATE TABLE table_name_43 (
    career_sr VARCHAR
) ### Response: SELECT career_sr FROM table_name_43 WHERE 1985 = "1r"


Instruction: What party was first elected in 1974?

Input:
CREATE TABLE table_1341453_7 (
    party VARCHAR,
    first_elected VARCHAR
)

Response: SELECT party FROM table_1341453_7 WHERE first_elected = 1974

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 party was first elected in 1974? ### Input: CREATE TABLE table_1341453_7 (
    party VARCHAR,
    first_elected VARCHAR
) ### Response: SELECT party FROM table_1341453_7 WHERE first_elected = 1974