Instruction: has the 'arterial bp mean' level of patient 433 remained normal since 10/23/2105?

Input:
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 labevents (
    row_id number,
    subject_id number,
    hadm_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

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

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

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 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 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 patients (
    row_id number,
    subject_id number,
    gender text,
    dob time,
    dod time
)

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

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

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

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

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

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

Response: SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 433)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean' AND d_items.linksto = 'chartevents') AND chartevents.valuenum BETWEEN mean_bp_lower AND mean_bp_upper AND STRFTIME('%y-%m-%d', chartevents.charttime) >= '2105-10-23'

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: has the 'arterial bp mean' level of patient 433 remained normal since 10/23/2105? ### Input: 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 labevents (
    row_id number,
    subject_id number,
    hadm_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

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

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

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 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 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 patients (
    row_id number,
    subject_id number,
    gender text,
    dob time,
    dod time
)

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

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

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

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

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

CREATE TABLE inputevents_cv (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    amount number
) ### Response: SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 433)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean' AND d_items.linksto = 'chartevents') AND chartevents.valuenum BETWEEN mean_bp_lower AND mean_bp_upper AND STRFTIME('%y-%m-%d', chartevents.charttime) >= '2105-10-23'


Instruction: provide the number of patients whose discharge location is short term hospital and admission year is before 2198

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

CREATE TABLE lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
)

Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.admityear < "2198"

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: provide the number of patients whose discharge location is short term hospital and admission year is before 2198 ### 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 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
)

CREATE TABLE lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.admityear < "2198"


Instruction: Find the name of the ships that have more than one captain.

Input:
CREATE TABLE ship (
    name VARCHAR,
    ship_id VARCHAR
)

CREATE TABLE captain (
    ship_id VARCHAR
)

Response: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING COUNT(*) > 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: Find the name of the ships that have more than one captain. ### Input: CREATE TABLE ship (
    name VARCHAR,
    ship_id VARCHAR
)

CREATE TABLE captain (
    ship_id VARCHAR
) ### Response: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING COUNT(*) > 1


Instruction: Which Runner-up has a Winning score of 20 (70-69-64-65=268)?

Input:
CREATE TABLE table_name_69 (
    runner_up VARCHAR,
    winning_score VARCHAR
)

Response: SELECT runner_up FROM table_name_69 WHERE winning_score = −20(70 - 69 - 64 - 65 = 268)

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 Runner-up has a Winning score of 20 (70-69-64-65=268)? ### Input: CREATE TABLE table_name_69 (
    runner_up VARCHAR,
    winning_score VARCHAR
) ### Response: SELECT runner_up FROM table_name_69 WHERE winning_score = −20(70 - 69 - 64 - 65 = 268)


Instruction: what is the game where the high points is by manu gin bili (26)?

Input:
CREATE TABLE table_27715173_8 (
    game VARCHAR,
    high_points VARCHAR
)

Response: SELECT game FROM table_27715173_8 WHERE high_points = "Manu Ginóbili (26)"

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 game where the high points is by manu gin bili (26)? ### Input: CREATE TABLE table_27715173_8 (
    game VARCHAR,
    high_points VARCHAR
) ### Response: SELECT game FROM table_27715173_8 WHERE high_points = "Manu Ginóbili (26)"


Instruction: What are the average Laps on Grid 15?

Input:
CREATE TABLE table_50944 (
    "Rider" text,
    "Manufacturer" text,
    "Laps" real,
    "Time" text,
    "Grid" real
)

Response: SELECT AVG("Laps") FROM table_50944 WHERE "Grid" = '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: What are the average Laps on Grid 15? ### Input: CREATE TABLE table_50944 (
    "Rider" text,
    "Manufacturer" text,
    "Laps" real,
    "Time" text,
    "Grid" real
) ### Response: SELECT AVG("Laps") FROM table_50944 WHERE "Grid" = '15'


Instruction: What event was in a year later than 2007 and in the 88th position?

Input:
CREATE TABLE table_66598 (
    "Year" real,
    "Competition" text,
    "Venue" text,
    "Position" text,
    "Event" text,
    "Notes" text
)

Response: SELECT "Event" FROM table_66598 WHERE "Year" > '2007' AND "Position" = '88th'

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 event was in a year later than 2007 and in the 88th position? ### Input: CREATE TABLE table_66598 (
    "Year" real,
    "Competition" text,
    "Venue" text,
    "Position" text,
    "Event" text,
    "Notes" text
) ### Response: SELECT "Event" FROM table_66598 WHERE "Year" > '2007' AND "Position" = '88th'


Instruction: Which highest 'goals against' number had wins of 19 and a 'goals for' number that was bigger than 53?

Input:
CREATE TABLE table_53525 (
    "Position" real,
    "Club" text,
    "Played" real,
    "Points" text,
    "Wins" real,
    "Draws" real,
    "Losses" real,
    "Goals for" real,
    "Goals against" real,
    "Goal Difference" real
)

Response: SELECT MAX("Goals against") FROM table_53525 WHERE "Wins" = '19' AND "Goals for" > '53'

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 'goals against' number had wins of 19 and a 'goals for' number that was bigger than 53? ### Input: CREATE TABLE table_53525 (
    "Position" real,
    "Club" text,
    "Played" real,
    "Points" text,
    "Wins" real,
    "Draws" real,
    "Losses" real,
    "Goals for" real,
    "Goals against" real,
    "Goal Difference" real
) ### Response: SELECT MAX("Goals against") FROM table_53525 WHERE "Wins" = '19' AND "Goals for" > '53'


Instruction: what is the name of the first player on this list ?

Input:
CREATE TABLE table_203_871 (
    id number,
    "#" number,
    "player" text,
    "pos" text,
    "pts" number,
    "tries" number,
    "conv" number,
    "pens" number,
    "drop" number,
    "opposition" text,
    "venue" text,
    "date" text
)

Response: SELECT "player" FROM table_203_871 WHERE id = 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 name of the first player on this list ? ### Input: CREATE TABLE table_203_871 (
    id number,
    "#" number,
    "player" text,
    "pos" text,
    "pts" number,
    "tries" number,
    "conv" number,
    "pens" number,
    "drop" number,
    "opposition" text,
    "venue" text,
    "date" text
) ### Response: SELECT "player" FROM table_203_871 WHERE id = 1


Instruction: What inverse subjunctive has as the imperative and a subjunctive of se m chadn?

Input:
CREATE TABLE table_42917 (
    "m\u00e5cha" text,
    "indicative" text,
    "imperative" text,
    "subjunctive" text,
    "inverse subjunctive" text
)

Response: SELECT "inverse subjunctive" FROM table_42917 WHERE "imperative" = '—' AND "subjunctive" = 'se måchadn'

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 inverse subjunctive has as the imperative and a subjunctive of se m chadn? ### Input: CREATE TABLE table_42917 (
    "m\u00e5cha" text,
    "indicative" text,
    "imperative" text,
    "subjunctive" text,
    "inverse subjunctive" text
) ### Response: SELECT "inverse subjunctive" FROM table_42917 WHERE "imperative" = '—' AND "subjunctive" = 'se måchadn'


Instruction: Which term in office has a qld state, a Party of labor, and an Electorate of fisher?

Input:
CREATE TABLE table_name_76 (
    term_in_office VARCHAR,
    electorate VARCHAR,
    state VARCHAR,
    party VARCHAR
)

Response: SELECT term_in_office FROM table_name_76 WHERE state = "qld" AND party = "labor" AND electorate = "fisher"

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 term in office has a qld state, a Party of labor, and an Electorate of fisher? ### Input: CREATE TABLE table_name_76 (
    term_in_office VARCHAR,
    electorate VARCHAR,
    state VARCHAR,
    party VARCHAR
) ### Response: SELECT term_in_office FROM table_name_76 WHERE state = "qld" AND party = "labor" AND electorate = "fisher"


Instruction: A bar chart for what are the number of the descriptions of all the project outcomes?, and show X in desc order.

Input:
CREATE TABLE Documents (
    document_id INTEGER,
    document_type_code VARCHAR(10),
    grant_id INTEGER,
    sent_date DATETIME,
    response_received_date DATETIME,
    other_details VARCHAR(255)
)

CREATE TABLE Grants (
    grant_id INTEGER,
    organisation_id INTEGER,
    grant_amount DECIMAL(19,4),
    grant_start_date DATETIME,
    grant_end_date DATETIME,
    other_details VARCHAR(255)
)

CREATE TABLE Staff_Roles (
    role_code VARCHAR(10),
    role_description VARCHAR(255)
)

CREATE TABLE Projects (
    project_id INTEGER,
    organisation_id INTEGER,
    project_details VARCHAR(255)
)

CREATE TABLE Research_Outcomes (
    outcome_code VARCHAR(10),
    outcome_description VARCHAR(255)
)

CREATE TABLE Organisations (
    organisation_id INTEGER,
    organisation_type VARCHAR(10),
    organisation_details VARCHAR(255)
)

CREATE TABLE Organisation_Types (
    organisation_type VARCHAR(10),
    organisation_type_description VARCHAR(255)
)

CREATE TABLE Research_Staff (
    staff_id INTEGER,
    employer_organisation_id INTEGER,
    staff_details VARCHAR(255)
)

CREATE TABLE Project_Outcomes (
    project_id INTEGER,
    outcome_code VARCHAR(10),
    outcome_details VARCHAR(255)
)

CREATE TABLE Project_Staff (
    staff_id DOUBLE,
    project_id INTEGER,
    role_code VARCHAR(10),
    date_from DATETIME,
    date_to DATETIME,
    other_details VARCHAR(255)
)

CREATE TABLE Document_Types (
    document_type_code VARCHAR(10),
    document_description VARCHAR(255)
)

CREATE TABLE Tasks (
    task_id INTEGER,
    project_id INTEGER,
    task_details VARCHAR(255),
    "eg Agree Objectives" VARCHAR(1)
)

Response: SELECT outcome_description, COUNT(outcome_description) FROM Research_Outcomes AS T1 JOIN Project_Outcomes AS T2 ON T1.outcome_code = T2.outcome_code GROUP BY outcome_description ORDER BY outcome_description 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 for what are the number of the descriptions of all the project outcomes?, and show X in desc order. ### Input: CREATE TABLE Documents (
    document_id INTEGER,
    document_type_code VARCHAR(10),
    grant_id INTEGER,
    sent_date DATETIME,
    response_received_date DATETIME,
    other_details VARCHAR(255)
)

CREATE TABLE Grants (
    grant_id INTEGER,
    organisation_id INTEGER,
    grant_amount DECIMAL(19,4),
    grant_start_date DATETIME,
    grant_end_date DATETIME,
    other_details VARCHAR(255)
)

CREATE TABLE Staff_Roles (
    role_code VARCHAR(10),
    role_description VARCHAR(255)
)

CREATE TABLE Projects (
    project_id INTEGER,
    organisation_id INTEGER,
    project_details VARCHAR(255)
)

CREATE TABLE Research_Outcomes (
    outcome_code VARCHAR(10),
    outcome_description VARCHAR(255)
)

CREATE TABLE Organisations (
    organisation_id INTEGER,
    organisation_type VARCHAR(10),
    organisation_details VARCHAR(255)
)

CREATE TABLE Organisation_Types (
    organisation_type VARCHAR(10),
    organisation_type_description VARCHAR(255)
)

CREATE TABLE Research_Staff (
    staff_id INTEGER,
    employer_organisation_id INTEGER,
    staff_details VARCHAR(255)
)

CREATE TABLE Project_Outcomes (
    project_id INTEGER,
    outcome_code VARCHAR(10),
    outcome_details VARCHAR(255)
)

CREATE TABLE Project_Staff (
    staff_id DOUBLE,
    project_id INTEGER,
    role_code VARCHAR(10),
    date_from DATETIME,
    date_to DATETIME,
    other_details VARCHAR(255)
)

CREATE TABLE Document_Types (
    document_type_code VARCHAR(10),
    document_description VARCHAR(255)
)

CREATE TABLE Tasks (
    task_id INTEGER,
    project_id INTEGER,
    task_details VARCHAR(255),
    "eg Agree Objectives" VARCHAR(1)
) ### Response: SELECT outcome_description, COUNT(outcome_description) FROM Research_Outcomes AS T1 JOIN Project_Outcomes AS T2 ON T1.outcome_code = T2.outcome_code GROUP BY outcome_description ORDER BY outcome_description DESC


Instruction: users with my same first name who have twitter in their about me.

Input:
CREATE TABLE PostNoticeTypes (
    Id number,
    ClassId number,
    Name text,
    Body text,
    IsHidden boolean,
    Predefined boolean,
    PostNoticeDurationId 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 PostTypes (
    Id number,
    Name text
)

CREATE TABLE Users (
    Id number,
    Reputation number,
    CreationDate time,
    DisplayName text,
    LastAccessDate time,
    WebsiteUrl text,
    Location text,
    AboutMe text,
    Views number,
    UpVotes number,
    DownVotes number,
    ProfileImageUrl text,
    EmailHash text,
    AccountId number
)

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

CREATE TABLE VoteTypes (
    Id number,
    Name text
)

CREATE TABLE PostNotices (
    Id number,
    PostId number,
    PostNoticeTypeId number,
    CreationDate time,
    DeletionDate time,
    ExpiryDate time,
    Body text,
    OwnerUserId number,
    DeletionUserId number
)

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

CREATE TABLE ReviewRejectionReasons (
    Id number,
    Name text,
    Description text,
    PostTypeId number
)

CREATE TABLE PostsWithDeleted (
    Id number,
    PostTypeId number,
    AcceptedAnswerId number,
    ParentId number,
    CreationDate time,
    DeletionDate time,
    Score number,
    ViewCount number,
    Body text,
    OwnerUserId number,
    OwnerDisplayName text,
    LastEditorUserId number,
    LastEditorDisplayName text,
    LastEditDate time,
    LastActivityDate time,
    Title text,
    Tags text,
    AnswerCount number,
    CommentCount number,
    FavoriteCount number,
    ClosedDate time,
    CommunityOwnedDate time,
    ContentLicense text
)

CREATE TABLE Comments (
    Id number,
    PostId number,
    Score number,
    Text text,
    CreationDate time,
    UserDisplayName text,
    UserId number,
    ContentLicense text
)

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

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

CREATE TABLE ReviewTasks (
    Id number,
    ReviewTaskTypeId number,
    CreationDate time,
    DeletionDate time,
    ReviewTaskStateId number,
    PostId number,
    SuggestedEditId number,
    CompletedByReviewTaskId number
)

CREATE TABLE Votes (
    Id number,
    PostId number,
    VoteTypeId number,
    UserId number,
    CreationDate time,
    BountyAmount number
)

CREATE TABLE PostHistoryTypes (
    Id number,
    Name text
)

CREATE TABLE PostTags (
    PostId number,
    TagId number
)

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

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

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

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

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

CREATE TABLE ReviewTaskResults (
    Id number,
    ReviewTaskId number,
    ReviewTaskResultTypeId number,
    CreationDate time,
    RejectionReasonId number,
    Comment text
)

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

CREATE TABLE Tags (
    Id number,
    TagName text,
    Count number,
    ExcerptPostId number,
    WikiPostId number
)

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

CREATE TABLE PendingFlags (
    Id number,
    FlagTypeId number,
    PostId number,
    CreationDate time,
    CloseReasonTypeId number,
    CloseAsOffTopicReasonTypeId number,
    DuplicateOfQuestionId number,
    BelongsOnBaseHostAddress text
)

CREATE TABLE 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 CloseReasonTypes (
    Id number,
    Name text,
    Description text
)

Response: SELECT COUNT(*) FROM Users WHERE DisplayName LIKE 'Abby %' AND WebsiteUrl LIKE '%twitter%'

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: users with my same first name who have twitter in their about me. ### Input: CREATE TABLE PostNoticeTypes (
    Id number,
    ClassId number,
    Name text,
    Body text,
    IsHidden boolean,
    Predefined boolean,
    PostNoticeDurationId 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 PostTypes (
    Id number,
    Name text
)

CREATE TABLE Users (
    Id number,
    Reputation number,
    CreationDate time,
    DisplayName text,
    LastAccessDate time,
    WebsiteUrl text,
    Location text,
    AboutMe text,
    Views number,
    UpVotes number,
    DownVotes number,
    ProfileImageUrl text,
    EmailHash text,
    AccountId number
)

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

CREATE TABLE VoteTypes (
    Id number,
    Name text
)

CREATE TABLE PostNotices (
    Id number,
    PostId number,
    PostNoticeTypeId number,
    CreationDate time,
    DeletionDate time,
    ExpiryDate time,
    Body text,
    OwnerUserId number,
    DeletionUserId number
)

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

CREATE TABLE ReviewRejectionReasons (
    Id number,
    Name text,
    Description text,
    PostTypeId number
)

CREATE TABLE PostsWithDeleted (
    Id number,
    PostTypeId number,
    AcceptedAnswerId number,
    ParentId number,
    CreationDate time,
    DeletionDate time,
    Score number,
    ViewCount number,
    Body text,
    OwnerUserId number,
    OwnerDisplayName text,
    LastEditorUserId number,
    LastEditorDisplayName text,
    LastEditDate time,
    LastActivityDate time,
    Title text,
    Tags text,
    AnswerCount number,
    CommentCount number,
    FavoriteCount number,
    ClosedDate time,
    CommunityOwnedDate time,
    ContentLicense text
)

CREATE TABLE Comments (
    Id number,
    PostId number,
    Score number,
    Text text,
    CreationDate time,
    UserDisplayName text,
    UserId number,
    ContentLicense text
)

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

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

CREATE TABLE ReviewTasks (
    Id number,
    ReviewTaskTypeId number,
    CreationDate time,
    DeletionDate time,
    ReviewTaskStateId number,
    PostId number,
    SuggestedEditId number,
    CompletedByReviewTaskId number
)

CREATE TABLE Votes (
    Id number,
    PostId number,
    VoteTypeId number,
    UserId number,
    CreationDate time,
    BountyAmount number
)

CREATE TABLE PostHistoryTypes (
    Id number,
    Name text
)

CREATE TABLE PostTags (
    PostId number,
    TagId number
)

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

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

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

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

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

CREATE TABLE ReviewTaskResults (
    Id number,
    ReviewTaskId number,
    ReviewTaskResultTypeId number,
    CreationDate time,
    RejectionReasonId number,
    Comment text
)

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

CREATE TABLE Tags (
    Id number,
    TagName text,
    Count number,
    ExcerptPostId number,
    WikiPostId number
)

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

CREATE TABLE PendingFlags (
    Id number,
    FlagTypeId number,
    PostId number,
    CreationDate time,
    CloseReasonTypeId number,
    CloseAsOffTopicReasonTypeId number,
    DuplicateOfQuestionId number,
    BelongsOnBaseHostAddress text
)

CREATE TABLE 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 CloseReasonTypes (
    Id number,
    Name text,
    Description text
) ### Response: SELECT COUNT(*) FROM Users WHERE DisplayName LIKE 'Abby %' AND WebsiteUrl LIKE '%twitter%'


Instruction: What is the score for the player who won $3,600?

Input:
CREATE TABLE table_name_40 (
    score VARCHAR,
    money___$__ VARCHAR
)

Response: SELECT score FROM table_name_40 WHERE money___$__ = "3,600"

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 score for the player who won $3,600? ### Input: CREATE TABLE table_name_40 (
    score VARCHAR,
    money___$__ VARCHAR
) ### Response: SELECT score FROM table_name_40 WHERE money___$__ = "3,600"


Instruction: Name the most field goals

Input:
CREATE TABLE table_72533 (
    "Player" text,
    "Position" text,
    "Starter" text,
    "Touchdowns" real,
    "Extra points" real,
    "Field goals" real,
    "Points" real
)

Response: SELECT MAX("Field goals") FROM table_72533

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 most field goals ### Input: CREATE TABLE table_72533 (
    "Player" text,
    "Position" text,
    "Starter" text,
    "Touchdowns" real,
    "Extra points" real,
    "Field goals" real,
    "Points" real
) ### Response: SELECT MAX("Field goals") FROM table_72533


Instruction: What year did jockey Ramon Dominguez have a distance of 1-1/16?

Input:
CREATE TABLE table_53833 (
    "Year" text,
    "Winner" text,
    "Jockey" text,
    "Trainer" text,
    "Owner" text,
    "Distance" text,
    "Time" text,
    "Purse" text
)

Response: SELECT "Year" FROM table_53833 WHERE "Distance" = '1-1/16' AND "Jockey" = 'ramon dominguez'

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 year did jockey Ramon Dominguez have a distance of 1-1/16? ### Input: CREATE TABLE table_53833 (
    "Year" text,
    "Winner" text,
    "Jockey" text,
    "Trainer" text,
    "Owner" text,
    "Distance" text,
    "Time" text,
    "Purse" text
) ### Response: SELECT "Year" FROM table_53833 WHERE "Distance" = '1-1/16' AND "Jockey" = 'ramon dominguez'


Instruction: What is the largest vote result if loss/gain is -0.5%?

Input:
CREATE TABLE table_73867 (
    "Constituency" text,
    "Candidate" text,
    "Affiliation" text,
    "Result - votes" real,
    "Result - %" text,
    "Loss/gain" text
)

Response: SELECT MAX("Result - votes") FROM table_73867 WHERE "Loss/gain" = '-0.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: What is the largest vote result if loss/gain is -0.5%? ### Input: CREATE TABLE table_73867 (
    "Constituency" text,
    "Candidate" text,
    "Affiliation" text,
    "Result - votes" real,
    "Result - %" text,
    "Loss/gain" text
) ### Response: SELECT MAX("Result - votes") FROM table_73867 WHERE "Loss/gain" = '-0.5%'


Instruction: What is the sum for December when the record was 22-12-5?

Input:
CREATE TABLE table_36845 (
    "Game" real,
    "December" real,
    "Opponent" text,
    "Score" text,
    "Record" text
)

Response: SELECT SUM("December") FROM table_36845 WHERE "Record" = '22-12-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: What is the sum for December when the record was 22-12-5? ### Input: CREATE TABLE table_36845 (
    "Game" real,
    "December" real,
    "Opponent" text,
    "Score" text,
    "Record" text
) ### Response: SELECT SUM("December") FROM table_36845 WHERE "Record" = '22-12-5'


Instruction: Find the number of professors in each office with a bar chart, and order y axis in descending order.

Input:
CREATE TABLE COURSE (
    CRS_CODE varchar(10),
    DEPT_CODE varchar(10),
    CRS_DESCRIPTION varchar(35),
    CRS_CREDIT float(8)
)

CREATE TABLE EMPLOYEE (
    EMP_NUM int,
    EMP_LNAME varchar(15),
    EMP_FNAME varchar(12),
    EMP_INITIAL varchar(1),
    EMP_JOBCODE varchar(5),
    EMP_HIREDATE datetime,
    EMP_DOB datetime
)

CREATE TABLE PROFESSOR (
    EMP_NUM int,
    DEPT_CODE varchar(10),
    PROF_OFFICE varchar(50),
    PROF_EXTENSION varchar(4),
    PROF_HIGH_DEGREE varchar(5)
)

CREATE TABLE STUDENT (
    STU_NUM int,
    STU_LNAME varchar(15),
    STU_FNAME varchar(15),
    STU_INIT varchar(1),
    STU_DOB datetime,
    STU_HRS int,
    STU_CLASS varchar(2),
    STU_GPA float(8),
    STU_TRANSFER numeric,
    DEPT_CODE varchar(18),
    STU_PHONE varchar(4),
    PROF_NUM int
)

CREATE TABLE ENROLL (
    CLASS_CODE varchar(5),
    STU_NUM int,
    ENROLL_GRADE varchar(50)
)

CREATE TABLE CLASS (
    CLASS_CODE varchar(5),
    CRS_CODE varchar(10),
    CLASS_SECTION varchar(2),
    CLASS_TIME varchar(20),
    CLASS_ROOM varchar(8),
    PROF_NUM int
)

CREATE TABLE DEPARTMENT (
    DEPT_CODE varchar(10),
    DEPT_NAME varchar(30),
    SCHOOL_CODE varchar(8),
    EMP_NUM int,
    DEPT_ADDRESS varchar(20),
    DEPT_EXTENSION varchar(4)
)

Response: SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM PROFESSOR AS T1 JOIN EMPLOYEE AS T2 ON T1.EMP_NUM = T2.EMP_NUM GROUP BY PROF_OFFICE ORDER BY COUNT(PROF_OFFICE) 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: Find the number of professors in each office with a bar chart, and order y axis in descending order. ### Input: CREATE TABLE COURSE (
    CRS_CODE varchar(10),
    DEPT_CODE varchar(10),
    CRS_DESCRIPTION varchar(35),
    CRS_CREDIT float(8)
)

CREATE TABLE EMPLOYEE (
    EMP_NUM int,
    EMP_LNAME varchar(15),
    EMP_FNAME varchar(12),
    EMP_INITIAL varchar(1),
    EMP_JOBCODE varchar(5),
    EMP_HIREDATE datetime,
    EMP_DOB datetime
)

CREATE TABLE PROFESSOR (
    EMP_NUM int,
    DEPT_CODE varchar(10),
    PROF_OFFICE varchar(50),
    PROF_EXTENSION varchar(4),
    PROF_HIGH_DEGREE varchar(5)
)

CREATE TABLE STUDENT (
    STU_NUM int,
    STU_LNAME varchar(15),
    STU_FNAME varchar(15),
    STU_INIT varchar(1),
    STU_DOB datetime,
    STU_HRS int,
    STU_CLASS varchar(2),
    STU_GPA float(8),
    STU_TRANSFER numeric,
    DEPT_CODE varchar(18),
    STU_PHONE varchar(4),
    PROF_NUM int
)

CREATE TABLE ENROLL (
    CLASS_CODE varchar(5),
    STU_NUM int,
    ENROLL_GRADE varchar(50)
)

CREATE TABLE CLASS (
    CLASS_CODE varchar(5),
    CRS_CODE varchar(10),
    CLASS_SECTION varchar(2),
    CLASS_TIME varchar(20),
    CLASS_ROOM varchar(8),
    PROF_NUM int
)

CREATE TABLE DEPARTMENT (
    DEPT_CODE varchar(10),
    DEPT_NAME varchar(30),
    SCHOOL_CODE varchar(8),
    EMP_NUM int,
    DEPT_ADDRESS varchar(20),
    DEPT_EXTENSION varchar(4)
) ### Response: SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM PROFESSOR AS T1 JOIN EMPLOYEE AS T2 ON T1.EMP_NUM = T2.EMP_NUM GROUP BY PROF_OFFICE ORDER BY COUNT(PROF_OFFICE) DESC


Instruction: How many members did Africa have the year that Australia had 94615?

Input:
CREATE TABLE table_22851 (
    "Year" real,
    "Worldwide" real,
    "Africa" real,
    "America" real,
    "Asia" real,
    "Australia" real,
    "Europe" real
)

Response: SELECT "Africa" FROM table_22851 WHERE "Australia" = '94615'

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 members did Africa have the year that Australia had 94615? ### Input: CREATE TABLE table_22851 (
    "Year" real,
    "Worldwide" real,
    "Africa" real,
    "America" real,
    "Asia" real,
    "Australia" real,
    "Europe" real
) ### Response: SELECT "Africa" FROM table_22851 WHERE "Australia" = '94615'


Instruction: List the total number of years that have a score of 3 6, 4 6, 2 6.

Input:
CREATE TABLE table_2533 (
    "Outcome" text,
    "Year" real,
    "Championship" text,
    "Surface" text,
    "Opponent in the final" text,
    "Score in the final" text
)

Response: SELECT COUNT("Year") FROM table_2533 WHERE "Score in the final" = '3–6, 4–6, 2–6'

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 total number of years that have a score of 3 6, 4 6, 2 6. ### Input: CREATE TABLE table_2533 (
    "Outcome" text,
    "Year" real,
    "Championship" text,
    "Surface" text,
    "Opponent in the final" text,
    "Score in the final" text
) ### Response: SELECT COUNT("Year") FROM table_2533 WHERE "Score in the final" = '3–6, 4–6, 2–6'


Instruction: What is the result when the Indianapolis Colts are the opponents?

Input:
CREATE TABLE table_55184 (
    "Week" text,
    "Date" text,
    "Opponent" text,
    "Result" text,
    "Kickoff [a ]" text,
    "Game site" text,
    "Attendance" text,
    "Record" text
)

Response: SELECT "Result" FROM table_55184 WHERE "Opponent" = 'indianapolis colts'

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 result when the Indianapolis Colts are the opponents? ### Input: CREATE TABLE table_55184 (
    "Week" text,
    "Date" text,
    "Opponent" text,
    "Result" text,
    "Kickoff [a ]" text,
    "Game site" text,
    "Attendance" text,
    "Record" text
) ### Response: SELECT "Result" FROM table_55184 WHERE "Opponent" = 'indianapolis colts'


Instruction: Which country does FC Atyrau represent after the 2006 season?

Input:
CREATE TABLE table_name_67 (
    country VARCHAR,
    season VARCHAR,
    team VARCHAR
)

Response: SELECT country FROM table_name_67 WHERE season > 2006 AND team = "fc atyrau"

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 country does FC Atyrau represent after the 2006 season? ### Input: CREATE TABLE table_name_67 (
    country VARCHAR,
    season VARCHAR,
    team VARCHAR
) ### Response: SELECT country FROM table_name_67 WHERE season > 2006 AND team = "fc atyrau"


Instruction: Who played in the Toronto Raptors from 1995-96?

Input:
CREATE TABLE table_15857 (
    "Player" text,
    "No." real,
    "Nationality" text,
    "Position" text,
    "Years in Toronto" text,
    "School/Club Team" text
)

Response: SELECT "Player" FROM table_15857 WHERE "Years in Toronto" = '1995-96'

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 played in the Toronto Raptors from 1995-96? ### Input: CREATE TABLE table_15857 (
    "Player" text,
    "No." real,
    "Nationality" text,
    "Position" text,
    "Years in Toronto" text,
    "School/Club Team" text
) ### Response: SELECT "Player" FROM table_15857 WHERE "Years in Toronto" = '1995-96'


Instruction: What's the sub-parish (sokn) of Eikefjord?

Input:
CREATE TABLE table_21949 (
    "Parish (Prestegjeld)" text,
    "Sub-Parish (Sokn)" text,
    "Church Name" text,
    "Year Built" text,
    "Location of the Church" text
)

Response: SELECT "Sub-Parish (Sokn)" FROM table_21949 WHERE "Location of the Church" = 'Eikefjord'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the sub-parish (sokn) of Eikefjord? ### Input: CREATE TABLE table_21949 (
    "Parish (Prestegjeld)" text,
    "Sub-Parish (Sokn)" text,
    "Church Name" text,
    "Year Built" text,
    "Location of the Church" text
) ### Response: SELECT "Sub-Parish (Sokn)" FROM table_21949 WHERE "Location of the Church" = 'Eikefjord'


Instruction: what's the first elected with district illinois 18

Input:
CREATE TABLE table_1341472_15 (
    first_elected VARCHAR,
    district VARCHAR
)

Response: SELECT first_elected FROM table_1341472_15 WHERE district = "Illinois 18"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the first elected with district illinois 18 ### Input: CREATE TABLE table_1341472_15 (
    first_elected VARCHAR,
    district VARCHAR
) ### Response: SELECT first_elected FROM table_1341472_15 WHERE district = "Illinois 18"


Instruction: What is the highest production number released on 1955-04-02 with i. freleng as the director?

Input:
CREATE TABLE table_79458 (
    "Title" text,
    "Series" text,
    "Director" text,
    "Production Number" real,
    "Release date" text
)

Response: SELECT MAX("Production Number") FROM table_79458 WHERE "Director" = 'i. freleng' AND "Release date" = '1955-04-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: What is the highest production number released on 1955-04-02 with i. freleng as the director? ### Input: CREATE TABLE table_79458 (
    "Title" text,
    "Series" text,
    "Director" text,
    "Production Number" real,
    "Release date" text
) ### Response: SELECT MAX("Production Number") FROM table_79458 WHERE "Director" = 'i. freleng' AND "Release date" = '1955-04-02'


Instruction: Orphan questions that were migrated from another site. Questions that were migrated and have no owner

Input:
CREATE TABLE Posts (
    Id number,
    PostTypeId number,
    AcceptedAnswerId number,
    ParentId number,
    CreationDate time,
    DeletionDate time,
    Score number,
    ViewCount number,
    Body text,
    OwnerUserId number,
    OwnerDisplayName text,
    LastEditorUserId number,
    LastEditorDisplayName text,
    LastEditDate time,
    LastActivityDate time,
    Title text,
    Tags text,
    AnswerCount number,
    CommentCount number,
    FavoriteCount number,
    ClosedDate time,
    CommunityOwnedDate time,
    ContentLicense text
)

CREATE TABLE PostsWithDeleted (
    Id number,
    PostTypeId number,
    AcceptedAnswerId number,
    ParentId number,
    CreationDate time,
    DeletionDate time,
    Score number,
    ViewCount number,
    Body text,
    OwnerUserId number,
    OwnerDisplayName text,
    LastEditorUserId number,
    LastEditorDisplayName text,
    LastEditDate time,
    LastActivityDate time,
    Title text,
    Tags text,
    AnswerCount number,
    CommentCount number,
    FavoriteCount number,
    ClosedDate time,
    CommunityOwnedDate time,
    ContentLicense text
)

CREATE TABLE ReviewTaskResults (
    Id number,
    ReviewTaskId number,
    ReviewTaskResultTypeId number,
    CreationDate time,
    RejectionReasonId number,
    Comment text
)

CREATE TABLE Comments (
    Id number,
    PostId number,
    Score number,
    Text text,
    CreationDate time,
    UserDisplayName text,
    UserId number,
    ContentLicense text
)

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

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

CREATE TABLE PostNotices (
    Id number,
    PostId number,
    PostNoticeTypeId number,
    CreationDate time,
    DeletionDate time,
    ExpiryDate time,
    Body text,
    OwnerUserId number,
    DeletionUserId number
)

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

CREATE TABLE Tags (
    Id number,
    TagName text,
    Count number,
    ExcerptPostId number,
    WikiPostId number
)

CREATE TABLE ReviewRejectionReasons (
    Id number,
    Name text,
    Description text,
    PostTypeId number
)

CREATE TABLE ReviewTasks (
    Id number,
    ReviewTaskTypeId number,
    CreationDate time,
    DeletionDate time,
    ReviewTaskStateId number,
    PostId number,
    SuggestedEditId number,
    CompletedByReviewTaskId number
)

CREATE TABLE PostHistoryTypes (
    Id number,
    Name text
)

CREATE TABLE PostTags (
    PostId number,
    TagId number
)

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

CREATE TABLE PostTypes (
    Id number,
    Name text
)

CREATE TABLE Users (
    Id number,
    Reputation number,
    CreationDate time,
    DisplayName text,
    LastAccessDate time,
    WebsiteUrl text,
    Location text,
    AboutMe text,
    Views number,
    UpVotes number,
    DownVotes number,
    ProfileImageUrl text,
    EmailHash text,
    AccountId number
)

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

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 PostLinks (
    Id number,
    CreationDate time,
    PostId number,
    RelatedPostId number,
    LinkTypeId number
)

CREATE TABLE PendingFlags (
    Id number,
    FlagTypeId number,
    PostId number,
    CreationDate time,
    CloseReasonTypeId number,
    CloseAsOffTopicReasonTypeId number,
    DuplicateOfQuestionId number,
    BelongsOnBaseHostAddress text
)

CREATE TABLE CloseAsOffTopicReasonTypes (
    Id number,
    IsUniversal boolean,
    InputTitle text,
    MarkdownInputGuidance text,
    MarkdownPostOwnerGuidance text,
    MarkdownPrivilegedUserGuidance text,
    MarkdownConcensusDescription text,
    CreationDate time,
    CreationModeratorId number,
    ApprovalDate time,
    ApprovalModeratorId number,
    DeactivationDate time,
    DeactivationModeratorId number
)

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

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

CREATE TABLE Votes (
    Id number,
    PostId number,
    VoteTypeId number,
    UserId number,
    CreationDate time,
    BountyAmount number
)

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

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

CREATE TABLE VoteTypes (
    Id number,
    Name text
)

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

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

Response: SELECT p.Id AS "post_link", p.CreationDate AS "date", p.OwnerDisplayName AS "current_user_name", ph.Comment AS "comment" FROM Posts AS p INNER JOIN PostHistory AS ph ON ph.PostId = p.Id WHERE ph.PostHistoryTypeId = 17 AND p.PostTypeId = 1 AND p.OwnerUserId IS NULL ORDER BY p.Id 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: Orphan questions that were migrated from another site. Questions that were migrated and have no owner ### Input: CREATE TABLE Posts (
    Id number,
    PostTypeId number,
    AcceptedAnswerId number,
    ParentId number,
    CreationDate time,
    DeletionDate time,
    Score number,
    ViewCount number,
    Body text,
    OwnerUserId number,
    OwnerDisplayName text,
    LastEditorUserId number,
    LastEditorDisplayName text,
    LastEditDate time,
    LastActivityDate time,
    Title text,
    Tags text,
    AnswerCount number,
    CommentCount number,
    FavoriteCount number,
    ClosedDate time,
    CommunityOwnedDate time,
    ContentLicense text
)

CREATE TABLE PostsWithDeleted (
    Id number,
    PostTypeId number,
    AcceptedAnswerId number,
    ParentId number,
    CreationDate time,
    DeletionDate time,
    Score number,
    ViewCount number,
    Body text,
    OwnerUserId number,
    OwnerDisplayName text,
    LastEditorUserId number,
    LastEditorDisplayName text,
    LastEditDate time,
    LastActivityDate time,
    Title text,
    Tags text,
    AnswerCount number,
    CommentCount number,
    FavoriteCount number,
    ClosedDate time,
    CommunityOwnedDate time,
    ContentLicense text
)

CREATE TABLE ReviewTaskResults (
    Id number,
    ReviewTaskId number,
    ReviewTaskResultTypeId number,
    CreationDate time,
    RejectionReasonId number,
    Comment text
)

CREATE TABLE Comments (
    Id number,
    PostId number,
    Score number,
    Text text,
    CreationDate time,
    UserDisplayName text,
    UserId number,
    ContentLicense text
)

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

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

CREATE TABLE PostNotices (
    Id number,
    PostId number,
    PostNoticeTypeId number,
    CreationDate time,
    DeletionDate time,
    ExpiryDate time,
    Body text,
    OwnerUserId number,
    DeletionUserId number
)

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

CREATE TABLE Tags (
    Id number,
    TagName text,
    Count number,
    ExcerptPostId number,
    WikiPostId number
)

CREATE TABLE ReviewRejectionReasons (
    Id number,
    Name text,
    Description text,
    PostTypeId number
)

CREATE TABLE ReviewTasks (
    Id number,
    ReviewTaskTypeId number,
    CreationDate time,
    DeletionDate time,
    ReviewTaskStateId number,
    PostId number,
    SuggestedEditId number,
    CompletedByReviewTaskId number
)

CREATE TABLE PostHistoryTypes (
    Id number,
    Name text
)

CREATE TABLE PostTags (
    PostId number,
    TagId number
)

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

CREATE TABLE PostTypes (
    Id number,
    Name text
)

CREATE TABLE Users (
    Id number,
    Reputation number,
    CreationDate time,
    DisplayName text,
    LastAccessDate time,
    WebsiteUrl text,
    Location text,
    AboutMe text,
    Views number,
    UpVotes number,
    DownVotes number,
    ProfileImageUrl text,
    EmailHash text,
    AccountId number
)

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

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 PostLinks (
    Id number,
    CreationDate time,
    PostId number,
    RelatedPostId number,
    LinkTypeId number
)

CREATE TABLE PendingFlags (
    Id number,
    FlagTypeId number,
    PostId number,
    CreationDate time,
    CloseReasonTypeId number,
    CloseAsOffTopicReasonTypeId number,
    DuplicateOfQuestionId number,
    BelongsOnBaseHostAddress text
)

CREATE TABLE CloseAsOffTopicReasonTypes (
    Id number,
    IsUniversal boolean,
    InputTitle text,
    MarkdownInputGuidance text,
    MarkdownPostOwnerGuidance text,
    MarkdownPrivilegedUserGuidance text,
    MarkdownConcensusDescription text,
    CreationDate time,
    CreationModeratorId number,
    ApprovalDate time,
    ApprovalModeratorId number,
    DeactivationDate time,
    DeactivationModeratorId number
)

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

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

CREATE TABLE Votes (
    Id number,
    PostId number,
    VoteTypeId number,
    UserId number,
    CreationDate time,
    BountyAmount number
)

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

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

CREATE TABLE VoteTypes (
    Id number,
    Name text
)

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

CREATE TABLE SuggestedEdits (
    Id number,
    PostId number,
    CreationDate time,
    ApprovalDate time,
    RejectionDate time,
    OwnerUserId number,
    Comment text,
    Text text,
    Title text,
    Tags text,
    RevisionGUID other
) ### Response: SELECT p.Id AS "post_link", p.CreationDate AS "date", p.OwnerDisplayName AS "current_user_name", ph.Comment AS "comment" FROM Posts AS p INNER JOIN PostHistory AS ph ON ph.PostId = p.Id WHERE ph.PostHistoryTypeId = 17 AND p.PostTypeId = 1 AND p.OwnerUserId IS NULL ORDER BY p.Id DESC LIMIT 1000


Instruction: For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by time, and I want to sort y-axis from low to high order.

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

CREATE TABLE regions (
    REGION_ID decimal(5,0),
    REGION_NAME varchar(25)
)

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

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

CREATE TABLE jobs (
    JOB_ID varchar(10),
    JOB_TITLE varchar(35),
    MIN_SALARY decimal(6,0),
    MAX_SALARY decimal(6,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)
)

Response: SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(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 was hired before 2002-06-21, draw a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by time, and I want to sort y-axis from low to high order. ### Input: CREATE TABLE employees (
    EMPLOYEE_ID decimal(6,0),
    FIRST_NAME varchar(20),
    LAST_NAME varchar(25),
    EMAIL varchar(25),
    PHONE_NUMBER varchar(20),
    HIRE_DATE date,
    JOB_ID varchar(10),
    SALARY decimal(8,2),
    COMMISSION_PCT decimal(2,2),
    MANAGER_ID decimal(6,0),
    DEPARTMENT_ID decimal(4,0)
)

CREATE TABLE regions (
    REGION_ID decimal(5,0),
    REGION_NAME varchar(25)
)

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

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

CREATE TABLE jobs (
    JOB_ID varchar(10),
    JOB_TITLE varchar(35),
    MIN_SALARY decimal(6,0),
    MAX_SALARY decimal(6,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)
) ### Response: SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(EMPLOYEE_ID)


Instruction: What is the Skip when the Third was john morris?

Input:
CREATE TABLE table_name_61 (
    skip VARCHAR,
    third VARCHAR
)

Response: SELECT skip FROM table_name_61 WHERE third = "john morris"

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 Skip when the Third was john morris? ### Input: CREATE TABLE table_name_61 (
    skip VARCHAR,
    third VARCHAR
) ### Response: SELECT skip FROM table_name_61 WHERE third = "john morris"


Instruction: Show the number of documents for each location code in a bar chart.

Input:
CREATE TABLE Ref_Calendar (
    Calendar_Date DATETIME,
    Day_Number INTEGER
)

CREATE TABLE Document_Locations (
    Document_ID INTEGER,
    Location_Code CHAR(15),
    Date_in_Location_From DATETIME,
    Date_in_Locaton_To DATETIME
)

CREATE TABLE Documents_to_be_Destroyed (
    Document_ID INTEGER,
    Destruction_Authorised_by_Employee_ID INTEGER,
    Destroyed_by_Employee_ID INTEGER,
    Planned_Destruction_Date DATETIME,
    Actual_Destruction_Date DATETIME,
    Other_Details VARCHAR(255)
)

CREATE TABLE Ref_Locations (
    Location_Code CHAR(15),
    Location_Name VARCHAR(255),
    Location_Description VARCHAR(255)
)

CREATE TABLE Employees (
    Employee_ID INTEGER,
    Role_Code CHAR(15),
    Employee_Name VARCHAR(255),
    Gender_MFU CHAR(1),
    Date_of_Birth DATETIME,
    Other_Details VARCHAR(255)
)

CREATE TABLE Roles (
    Role_Code CHAR(15),
    Role_Name VARCHAR(255),
    Role_Description VARCHAR(255)
)

CREATE TABLE All_Documents (
    Document_ID INTEGER,
    Date_Stored DATETIME,
    Document_Type_Code CHAR(15),
    Document_Name CHAR(255),
    Document_Description CHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Ref_Document_Types (
    Document_Type_Code CHAR(15),
    Document_Type_Name VARCHAR(255),
    Document_Type_Description VARCHAR(255)
)

Response: SELECT Location_Code, COUNT(Location_Code) FROM Document_Locations GROUP BY Location_Code

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 number of documents for each location code in a bar chart. ### Input: CREATE TABLE Ref_Calendar (
    Calendar_Date DATETIME,
    Day_Number INTEGER
)

CREATE TABLE Document_Locations (
    Document_ID INTEGER,
    Location_Code CHAR(15),
    Date_in_Location_From DATETIME,
    Date_in_Locaton_To DATETIME
)

CREATE TABLE Documents_to_be_Destroyed (
    Document_ID INTEGER,
    Destruction_Authorised_by_Employee_ID INTEGER,
    Destroyed_by_Employee_ID INTEGER,
    Planned_Destruction_Date DATETIME,
    Actual_Destruction_Date DATETIME,
    Other_Details VARCHAR(255)
)

CREATE TABLE Ref_Locations (
    Location_Code CHAR(15),
    Location_Name VARCHAR(255),
    Location_Description VARCHAR(255)
)

CREATE TABLE Employees (
    Employee_ID INTEGER,
    Role_Code CHAR(15),
    Employee_Name VARCHAR(255),
    Gender_MFU CHAR(1),
    Date_of_Birth DATETIME,
    Other_Details VARCHAR(255)
)

CREATE TABLE Roles (
    Role_Code CHAR(15),
    Role_Name VARCHAR(255),
    Role_Description VARCHAR(255)
)

CREATE TABLE All_Documents (
    Document_ID INTEGER,
    Date_Stored DATETIME,
    Document_Type_Code CHAR(15),
    Document_Name CHAR(255),
    Document_Description CHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Ref_Document_Types (
    Document_Type_Code CHAR(15),
    Document_Type_Name VARCHAR(255),
    Document_Type_Description VARCHAR(255)
) ### Response: SELECT Location_Code, COUNT(Location_Code) FROM Document_Locations GROUP BY Location_Code


Instruction: What is the 3rd largest when 2nd largest in Minab?

Input:
CREATE TABLE table_48113 (
    "Province" text,
    "Largest city" text,
    "2nd Largest" text,
    "3rd Largest" text,
    "4th largest" text
)

Response: SELECT "3rd Largest" FROM table_48113 WHERE "2nd Largest" = 'minab'

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 3rd largest when 2nd largest in Minab? ### Input: CREATE TABLE table_48113 (
    "Province" text,
    "Largest city" text,
    "2nd Largest" text,
    "3rd Largest" text,
    "4th largest" text
) ### Response: SELECT "3rd Largest" FROM table_48113 WHERE "2nd Largest" = 'minab'


Instruction: What type of game was held against France with the results of 3:1?

Input:
CREATE TABLE table_6658 (
    "Date" text,
    "City" text,
    "Opponent" text,
    "Results\u00b9" text,
    "Type of game" text
)

Response: SELECT "Type of game" FROM table_6658 WHERE "Results\u00b9" = '3:1' AND "Opponent" = 'france'

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 type of game was held against France with the results of 3:1? ### Input: CREATE TABLE table_6658 (
    "Date" text,
    "City" text,
    "Opponent" text,
    "Results\u00b9" text,
    "Type of game" text
) ### Response: SELECT "Type of game" FROM table_6658 WHERE "Results\u00b9" = '3:1' AND "Opponent" = 'france'


Instruction: Give the number of patients that died with a drug named pneumococcal vac polyvalent.

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

CREATE TABLE lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
)

CREATE TABLE demographic (
    subject_id text,
    hadm_id text,
    name text,
    marital_status text,
    age text,
    dob text,
    gender text,
    language text,
    religion text,
    admission_type text,
    days_stay text,
    insurance text,
    ethnicity text,
    expire_flag text,
    admission_location text,
    discharge_location text,
    diagnosis text,
    dod text,
    dob_year text,
    dod_year text,
    admittime text,
    dischtime text,
    admityear text
)

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

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

Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.drug = "PNEUMOcoccal Vac Polyvalent"

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 the number of patients that died with a drug named pneumococcal vac polyvalent. ### Input: CREATE TABLE diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
)

CREATE TABLE demographic (
    subject_id text,
    hadm_id text,
    name text,
    marital_status text,
    age text,
    dob text,
    gender text,
    language text,
    religion text,
    admission_type text,
    days_stay text,
    insurance text,
    ethnicity text,
    expire_flag text,
    admission_location text,
    discharge_location text,
    diagnosis text,
    dod text,
    dob_year text,
    dod_year text,
    admittime text,
    dischtime text,
    admityear text
)

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

CREATE TABLE prescriptions (
    subject_id text,
    hadm_id text,
    icustay_id text,
    drug_type text,
    drug text,
    formulary_drug_cd text,
    route text,
    drug_dose text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.drug = "PNEUMOcoccal Vac Polyvalent"


Instruction: Which song had Central Station as a label and whose album was Various - Wild Nights 4?

Input:
CREATE TABLE table_31987 (
    "Year" real,
    "Album" text,
    "Song" text,
    "Label" text,
    "Catalog#" text,
    "Format" text,
    "Country" text
)

Response: SELECT "Song" FROM table_31987 WHERE "Label" = 'central station' AND "Album" = 'various - wild nights 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: Which song had Central Station as a label and whose album was Various - Wild Nights 4? ### Input: CREATE TABLE table_31987 (
    "Year" real,
    "Album" text,
    "Song" text,
    "Label" text,
    "Catalog#" text,
    "Format" text,
    "Country" text
) ### Response: SELECT "Song" FROM table_31987 WHERE "Label" = 'central station' AND "Album" = 'various - wild nights 4'


Instruction: Who had more than 3 wins?

Input:
CREATE TABLE table_10510 (
    "Season" text,
    "Winner" text,
    "Team" text,
    "Position" text,
    "Win #" real
)

Response: SELECT "Winner" FROM table_10510 WHERE "Win #" > '3'

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 had more than 3 wins? ### Input: CREATE TABLE table_10510 (
    "Season" text,
    "Winner" text,
    "Team" text,
    "Position" text,
    "Win #" real
) ### Response: SELECT "Winner" FROM table_10510 WHERE "Win #" > '3'


Instruction: how many times was the televote/sms 2.39% and the place more than 9?

Input:
CREATE TABLE table_66500 (
    "Draw" real,
    "Artist" text,
    "Song" text,
    "Televote/SMS" text,
    "Place" real
)

Response: SELECT COUNT("Draw") FROM table_66500 WHERE "Televote/SMS" = '2.39%' AND "Place" > '9'

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 times was the televote/sms 2.39% and the place more than 9? ### Input: CREATE TABLE table_66500 (
    "Draw" real,
    "Artist" text,
    "Song" text,
    "Televote/SMS" text,
    "Place" real
) ### Response: SELECT COUNT("Draw") FROM table_66500 WHERE "Televote/SMS" = '2.39%' AND "Place" > '9'


Instruction: from WASHINGTON to ATLANTA

Input:
CREATE TABLE flight_stop (
    flight_id int,
    stop_number int,
    stop_days text,
    stop_airport text,
    arrival_time int,
    arrival_airline text,
    arrival_flight_number int,
    departure_time int,
    departure_airline text,
    departure_flight_number int,
    stop_time int
)

CREATE TABLE month (
    month_number int,
    month_name text
)

CREATE TABLE flight_fare (
    flight_id int,
    fare_id int
)

CREATE TABLE fare_basis (
    fare_basis_code text,
    booking_class text,
    class_type text,
    premium text,
    economy text,
    discounted text,
    night text,
    season text,
    basis_days text
)

CREATE TABLE airline (
    airline_code varchar,
    airline_name text,
    note text
)

CREATE TABLE airport (
    airport_code varchar,
    airport_name text,
    airport_location text,
    state_code varchar,
    country_name varchar,
    time_zone_code varchar,
    minimum_connect_time int
)

CREATE TABLE equipment_sequence (
    aircraft_code_sequence varchar,
    aircraft_code varchar
)

CREATE TABLE ground_service (
    city_code text,
    airport_code text,
    transport_type text,
    ground_fare int
)

CREATE TABLE aircraft (
    aircraft_code varchar,
    aircraft_description varchar,
    manufacturer varchar,
    basic_type varchar,
    engines int,
    propulsion varchar,
    wide_body varchar,
    wing_span int,
    length int,
    weight int,
    capacity int,
    pay_load int,
    cruising_speed int,
    range_miles int,
    pressurized varchar
)

CREATE TABLE city (
    city_code varchar,
    city_name varchar,
    state_code varchar,
    country_name varchar,
    time_zone_code varchar
)

CREATE TABLE food_service (
    meal_code text,
    meal_number int,
    compartment text,
    meal_description varchar
)

CREATE TABLE code_description (
    code varchar,
    description text
)

CREATE TABLE flight_leg (
    flight_id int,
    leg_number int,
    leg_flight int
)

CREATE TABLE fare (
    fare_id int,
    from_airport varchar,
    to_airport varchar,
    fare_basis_code text,
    fare_airline text,
    restriction_code text,
    one_direction_cost int,
    round_trip_cost int,
    round_trip_required varchar
)

CREATE TABLE dual_carrier (
    main_airline varchar,
    low_flight_number int,
    high_flight_number int,
    dual_airline varchar,
    service_name text
)

CREATE TABLE days (
    days_code varchar,
    day_name varchar
)

CREATE TABLE state (
    state_code text,
    state_name text,
    country_name text
)

CREATE TABLE airport_service (
    city_code varchar,
    airport_code varchar,
    miles_distant int,
    direction varchar,
    minutes_distant int
)

CREATE TABLE class_of_service (
    booking_class varchar,
    rank int,
    class_description text
)

CREATE TABLE time_interval (
    period text,
    begin_time int,
    end_time int
)

CREATE TABLE date_day (
    month_number int,
    day_number int,
    year int,
    day_name varchar
)

CREATE TABLE restriction (
    restriction_code text,
    advance_purchase int,
    stopovers text,
    saturday_stay_required text,
    minimum_stay int,
    maximum_stay int,
    application text,
    no_discounts text
)

CREATE TABLE time_zone (
    time_zone_code text,
    time_zone_name text,
    hours_from_gmt int
)

CREATE TABLE flight (
    aircraft_code_sequence text,
    airline_code varchar,
    airline_flight text,
    arrival_time int,
    connections int,
    departure_time int,
    dual_carrier text,
    flight_days text,
    flight_id int,
    flight_number int,
    from_airport varchar,
    meal_code text,
    stops int,
    time_elapsed int,
    to_airport varchar
)

CREATE TABLE compartment_class (
    compartment varchar,
    class_type varchar
)

Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code

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: from WASHINGTON to ATLANTA ### Input: CREATE TABLE flight_stop (
    flight_id int,
    stop_number int,
    stop_days text,
    stop_airport text,
    arrival_time int,
    arrival_airline text,
    arrival_flight_number int,
    departure_time int,
    departure_airline text,
    departure_flight_number int,
    stop_time int
)

CREATE TABLE month (
    month_number int,
    month_name text
)

CREATE TABLE flight_fare (
    flight_id int,
    fare_id int
)

CREATE TABLE fare_basis (
    fare_basis_code text,
    booking_class text,
    class_type text,
    premium text,
    economy text,
    discounted text,
    night text,
    season text,
    basis_days text
)

CREATE TABLE airline (
    airline_code varchar,
    airline_name text,
    note text
)

CREATE TABLE airport (
    airport_code varchar,
    airport_name text,
    airport_location text,
    state_code varchar,
    country_name varchar,
    time_zone_code varchar,
    minimum_connect_time int
)

CREATE TABLE equipment_sequence (
    aircraft_code_sequence varchar,
    aircraft_code varchar
)

CREATE TABLE ground_service (
    city_code text,
    airport_code text,
    transport_type text,
    ground_fare int
)

CREATE TABLE aircraft (
    aircraft_code varchar,
    aircraft_description varchar,
    manufacturer varchar,
    basic_type varchar,
    engines int,
    propulsion varchar,
    wide_body varchar,
    wing_span int,
    length int,
    weight int,
    capacity int,
    pay_load int,
    cruising_speed int,
    range_miles int,
    pressurized varchar
)

CREATE TABLE city (
    city_code varchar,
    city_name varchar,
    state_code varchar,
    country_name varchar,
    time_zone_code varchar
)

CREATE TABLE food_service (
    meal_code text,
    meal_number int,
    compartment text,
    meal_description varchar
)

CREATE TABLE code_description (
    code varchar,
    description text
)

CREATE TABLE flight_leg (
    flight_id int,
    leg_number int,
    leg_flight int
)

CREATE TABLE fare (
    fare_id int,
    from_airport varchar,
    to_airport varchar,
    fare_basis_code text,
    fare_airline text,
    restriction_code text,
    one_direction_cost int,
    round_trip_cost int,
    round_trip_required varchar
)

CREATE TABLE dual_carrier (
    main_airline varchar,
    low_flight_number int,
    high_flight_number int,
    dual_airline varchar,
    service_name text
)

CREATE TABLE days (
    days_code varchar,
    day_name varchar
)

CREATE TABLE state (
    state_code text,
    state_name text,
    country_name text
)

CREATE TABLE airport_service (
    city_code varchar,
    airport_code varchar,
    miles_distant int,
    direction varchar,
    minutes_distant int
)

CREATE TABLE class_of_service (
    booking_class varchar,
    rank int,
    class_description text
)

CREATE TABLE time_interval (
    period text,
    begin_time int,
    end_time int
)

CREATE TABLE date_day (
    month_number int,
    day_number int,
    year int,
    day_name varchar
)

CREATE TABLE restriction (
    restriction_code text,
    advance_purchase int,
    stopovers text,
    saturday_stay_required text,
    minimum_stay int,
    maximum_stay int,
    application text,
    no_discounts text
)

CREATE TABLE time_zone (
    time_zone_code text,
    time_zone_name text,
    hours_from_gmt int
)

CREATE TABLE flight (
    aircraft_code_sequence text,
    airline_code varchar,
    airline_flight text,
    arrival_time int,
    connections int,
    departure_time int,
    dual_carrier text,
    flight_days text,
    flight_id int,
    flight_number int,
    from_airport varchar,
    meal_code text,
    stops int,
    time_elapsed int,
    to_airport varchar
)

CREATE TABLE compartment_class (
    compartment varchar,
    class_type varchar
) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code


Instruction: plasma creatinine > 2 mg / dl.

Input:
CREATE TABLE table_train_119 (
    "id" int,
    "systolic_blood_pressure_sbp" int,
    "hemoglobin_a1c_hba1c" float,
    "diastolic_blood_pressure_dbp" int,
    "hypotension" bool,
    "allergy_to_milk" bool,
    "allergy_to_soy" bool,
    "body_mass_index_bmi" float,
    "plasma_creatinine" float,
    "NOUSE" float
)

Response: SELECT * FROM table_train_119 WHERE plasma_creatinine > 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: plasma creatinine > 2 mg / dl. ### Input: CREATE TABLE table_train_119 (
    "id" int,
    "systolic_blood_pressure_sbp" int,
    "hemoglobin_a1c_hba1c" float,
    "diastolic_blood_pressure_dbp" int,
    "hypotension" bool,
    "allergy_to_milk" bool,
    "allergy_to_soy" bool,
    "body_mass_index_bmi" float,
    "plasma_creatinine" float,
    "NOUSE" float
) ### Response: SELECT * FROM table_train_119 WHERE plasma_creatinine > 2


Instruction: how many years did an jae sung play ?

Input:
CREATE TABLE table_204_177 (
    id number,
    "player" text,
    "years played" text,
    "total w-l" text,
    "singles w-l" text,
    "doubles w-l" text
)

Response: SELECT "years played" FROM table_204_177 WHERE "player" = 'an jae-sung'

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 years did an jae sung play ? ### Input: CREATE TABLE table_204_177 (
    id number,
    "player" text,
    "years played" text,
    "total w-l" text,
    "singles w-l" text,
    "doubles w-l" text
) ### Response: SELECT "years played" FROM table_204_177 WHERE "player" = 'an jae-sung'


Instruction: Name the week for date of bye

Input:
CREATE TABLE table_39203 (
    "Week" text,
    "Date" text,
    "Opponent" text,
    "Result" text,
    "Record" text
)

Response: SELECT "Week" FROM table_39203 WHERE "Date" = 'bye'

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 week for date of bye ### Input: CREATE TABLE table_39203 (
    "Week" text,
    "Date" text,
    "Opponent" text,
    "Result" text,
    "Record" text
) ### Response: SELECT "Week" FROM table_39203 WHERE "Date" = 'bye'


Instruction: A bar chart for what are the number of the names of the workshop groups that have bookings with status code 'stop'?, I want to list by the Y in asc.

Input:
CREATE TABLE Clients (
    Client_ID INTEGER,
    Address_ID INTEGER,
    Customer_Email_Address VARCHAR(255),
    Customer_Name VARCHAR(255),
    Customer_Phone VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Addresses (
    Address_ID VARCHAR(100),
    Line_1 VARCHAR(255),
    Line_2 VARCHAR(255),
    City_Town VARCHAR(255),
    State_County VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Customers (
    Customer_ID VARCHAR(100),
    Address_ID INTEGER,
    Customer_Name VARCHAR(255),
    Customer_Phone VARCHAR(255),
    Customer_Email_Address VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Ref_Payment_Methods (
    payment_method_code CHAR(10),
    payment_method_description VARCHAR(80)
)

CREATE TABLE Services (
    Service_ID INTEGER,
    Service_Type_Code CHAR(15),
    Workshop_Group_ID INTEGER,
    Product_Description VARCHAR(255),
    Product_Name VARCHAR(255),
    Product_Price DECIMAL(20,4),
    Other_Product_Service_Details VARCHAR(255)
)

CREATE TABLE Invoices (
    Invoice_ID INTEGER,
    Order_ID INTEGER,
    payment_method_code CHAR(15),
    Product_ID INTEGER,
    Order_Quantity VARCHAR(288),
    Other_Item_Details VARCHAR(255),
    Order_Item_ID INTEGER
)

CREATE TABLE Marketing_Regions (
    Marketing_Region_Code CHAR(15),
    Marketing_Region_Name VARCHAR(255),
    Marketing_Region_Descriptrion VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Order_Items (
    Order_Item_ID INTEGER,
    Order_ID INTEGER,
    Product_ID INTEGER,
    Order_Quantity VARCHAR(288),
    Other_Item_Details VARCHAR(255)
)

CREATE TABLE Performers (
    Performer_ID INTEGER,
    Address_ID INTEGER,
    Customer_Name VARCHAR(255),
    Customer_Phone VARCHAR(255),
    Customer_Email_Address VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Drama_Workshop_Groups (
    Workshop_Group_ID INTEGER,
    Address_ID INTEGER,
    Currency_Code CHAR(15),
    Marketing_Region_Code CHAR(15),
    Store_Name VARCHAR(255),
    Store_Phone VARCHAR(255),
    Store_Email_Address VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Invoice_Items (
    Invoice_Item_ID INTEGER,
    Invoice_ID INTEGER,
    Order_ID INTEGER,
    Order_Item_ID INTEGER,
    Product_ID INTEGER,
    Order_Quantity INTEGER,
    Other_Item_Details VARCHAR(255)
)

CREATE TABLE Ref_Service_Types (
    Service_Type_Code CHAR(15),
    Parent_Service_Type_Code CHAR(15),
    Service_Type_Description VARCHAR(255)
)

CREATE TABLE Stores (
    Store_ID VARCHAR(100),
    Address_ID INTEGER,
    Marketing_Region_Code CHAR(15),
    Store_Name VARCHAR(255),
    Store_Phone VARCHAR(255),
    Store_Email_Address VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Customer_Orders (
    Order_ID INTEGER,
    Customer_ID INTEGER,
    Store_ID INTEGER,
    Order_Date DATETIME,
    Planned_Delivery_Date DATETIME,
    Actual_Delivery_Date DATETIME,
    Other_Order_Details VARCHAR(255)
)

CREATE TABLE Performers_in_Bookings (
    Order_ID INTEGER,
    Performer_ID INTEGER
)

CREATE TABLE Bookings (
    Booking_ID INTEGER,
    Customer_ID INTEGER,
    Workshop_Group_ID VARCHAR(100),
    Status_Code CHAR(15),
    Store_ID INTEGER,
    Order_Date DATETIME,
    Planned_Delivery_Date DATETIME,
    Actual_Delivery_Date DATETIME,
    Other_Order_Details VARCHAR(255)
)

CREATE TABLE Products (
    Product_ID VARCHAR(100),
    Product_Name VARCHAR(255),
    Product_Price DECIMAL(20,4),
    Product_Description VARCHAR(255),
    Other_Product_Service_Details VARCHAR(255)
)

CREATE TABLE Bookings_Services (
    Order_ID INTEGER,
    Product_ID INTEGER
)

Response: SELECT Store_Name, COUNT(Store_Name) FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" GROUP BY Store_Name ORDER BY COUNT(Store_Name)

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for what are the number of the names of the workshop groups that have bookings with status code 'stop'?, I want to list by the Y in asc. ### Input: CREATE TABLE Clients (
    Client_ID INTEGER,
    Address_ID INTEGER,
    Customer_Email_Address VARCHAR(255),
    Customer_Name VARCHAR(255),
    Customer_Phone VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Addresses (
    Address_ID VARCHAR(100),
    Line_1 VARCHAR(255),
    Line_2 VARCHAR(255),
    City_Town VARCHAR(255),
    State_County VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Customers (
    Customer_ID VARCHAR(100),
    Address_ID INTEGER,
    Customer_Name VARCHAR(255),
    Customer_Phone VARCHAR(255),
    Customer_Email_Address VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Ref_Payment_Methods (
    payment_method_code CHAR(10),
    payment_method_description VARCHAR(80)
)

CREATE TABLE Services (
    Service_ID INTEGER,
    Service_Type_Code CHAR(15),
    Workshop_Group_ID INTEGER,
    Product_Description VARCHAR(255),
    Product_Name VARCHAR(255),
    Product_Price DECIMAL(20,4),
    Other_Product_Service_Details VARCHAR(255)
)

CREATE TABLE Invoices (
    Invoice_ID INTEGER,
    Order_ID INTEGER,
    payment_method_code CHAR(15),
    Product_ID INTEGER,
    Order_Quantity VARCHAR(288),
    Other_Item_Details VARCHAR(255),
    Order_Item_ID INTEGER
)

CREATE TABLE Marketing_Regions (
    Marketing_Region_Code CHAR(15),
    Marketing_Region_Name VARCHAR(255),
    Marketing_Region_Descriptrion VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Order_Items (
    Order_Item_ID INTEGER,
    Order_ID INTEGER,
    Product_ID INTEGER,
    Order_Quantity VARCHAR(288),
    Other_Item_Details VARCHAR(255)
)

CREATE TABLE Performers (
    Performer_ID INTEGER,
    Address_ID INTEGER,
    Customer_Name VARCHAR(255),
    Customer_Phone VARCHAR(255),
    Customer_Email_Address VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Drama_Workshop_Groups (
    Workshop_Group_ID INTEGER,
    Address_ID INTEGER,
    Currency_Code CHAR(15),
    Marketing_Region_Code CHAR(15),
    Store_Name VARCHAR(255),
    Store_Phone VARCHAR(255),
    Store_Email_Address VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Invoice_Items (
    Invoice_Item_ID INTEGER,
    Invoice_ID INTEGER,
    Order_ID INTEGER,
    Order_Item_ID INTEGER,
    Product_ID INTEGER,
    Order_Quantity INTEGER,
    Other_Item_Details VARCHAR(255)
)

CREATE TABLE Ref_Service_Types (
    Service_Type_Code CHAR(15),
    Parent_Service_Type_Code CHAR(15),
    Service_Type_Description VARCHAR(255)
)

CREATE TABLE Stores (
    Store_ID VARCHAR(100),
    Address_ID INTEGER,
    Marketing_Region_Code CHAR(15),
    Store_Name VARCHAR(255),
    Store_Phone VARCHAR(255),
    Store_Email_Address VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Customer_Orders (
    Order_ID INTEGER,
    Customer_ID INTEGER,
    Store_ID INTEGER,
    Order_Date DATETIME,
    Planned_Delivery_Date DATETIME,
    Actual_Delivery_Date DATETIME,
    Other_Order_Details VARCHAR(255)
)

CREATE TABLE Performers_in_Bookings (
    Order_ID INTEGER,
    Performer_ID INTEGER
)

CREATE TABLE Bookings (
    Booking_ID INTEGER,
    Customer_ID INTEGER,
    Workshop_Group_ID VARCHAR(100),
    Status_Code CHAR(15),
    Store_ID INTEGER,
    Order_Date DATETIME,
    Planned_Delivery_Date DATETIME,
    Actual_Delivery_Date DATETIME,
    Other_Order_Details VARCHAR(255)
)

CREATE TABLE Products (
    Product_ID VARCHAR(100),
    Product_Name VARCHAR(255),
    Product_Price DECIMAL(20,4),
    Product_Description VARCHAR(255),
    Other_Product_Service_Details VARCHAR(255)
)

CREATE TABLE Bookings_Services (
    Order_ID INTEGER,
    Product_ID INTEGER
) ### Response: SELECT Store_Name, COUNT(Store_Name) FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" GROUP BY Store_Name ORDER BY COUNT(Store_Name)


Instruction: What is the sum of the drawn values for teams with 2 losses?

Input:
CREATE TABLE table_name_45 (
    drawn INTEGER,
    lost VARCHAR
)

Response: SELECT SUM(drawn) FROM table_name_45 WHERE lost = 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: What is the sum of the drawn values for teams with 2 losses? ### Input: CREATE TABLE table_name_45 (
    drawn INTEGER,
    lost VARCHAR
) ### Response: SELECT SUM(drawn) FROM table_name_45 WHERE lost = 2


Instruction: What is the average rating of songs for each language. Plot them as pie chart.

Input:
CREATE TABLE genre (
    g_name varchar2(20),
    rating varchar2(10),
    most_popular_in varchar2(50)
)

CREATE TABLE artist (
    artist_name varchar2(50),
    country varchar2(20),
    gender varchar2(20),
    preferred_genre varchar2(50)
)

CREATE TABLE files (
    f_id number(10),
    artist_name varchar2(50),
    file_size varchar2(20),
    duration varchar2(20),
    formats varchar2(20)
)

CREATE TABLE song (
    song_name varchar2(50),
    artist_name varchar2(50),
    country varchar2(20),
    f_id number(10),
    genre_is varchar2(20),
    rating number(10),
    languages varchar2(20),
    releasedate Date,
    resolution number(10)
)

Response: SELECT languages, AVG(rating) FROM song GROUP BY languages

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average rating of songs for each language. Plot them as pie chart. ### Input: CREATE TABLE genre (
    g_name varchar2(20),
    rating varchar2(10),
    most_popular_in varchar2(50)
)

CREATE TABLE artist (
    artist_name varchar2(50),
    country varchar2(20),
    gender varchar2(20),
    preferred_genre varchar2(50)
)

CREATE TABLE files (
    f_id number(10),
    artist_name varchar2(50),
    file_size varchar2(20),
    duration varchar2(20),
    formats varchar2(20)
)

CREATE TABLE song (
    song_name varchar2(50),
    artist_name varchar2(50),
    country varchar2(20),
    f_id number(10),
    genre_is varchar2(20),
    rating number(10),
    languages varchar2(20),
    releasedate Date,
    resolution number(10)
) ### Response: SELECT languages, AVG(rating) FROM song GROUP BY languages


Instruction: What is the total number of Wins, when Top-25 is less than 4, and when Top-10 is less than 1?

Input:
CREATE TABLE table_name_81 (
    wins VARCHAR,
    top_25 VARCHAR,
    top_10 VARCHAR
)

Response: SELECT COUNT(wins) FROM table_name_81 WHERE top_25 < 4 AND top_10 < 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 total number of Wins, when Top-25 is less than 4, and when Top-10 is less than 1? ### Input: CREATE TABLE table_name_81 (
    wins VARCHAR,
    top_25 VARCHAR,
    top_10 VARCHAR
) ### Response: SELECT COUNT(wins) FROM table_name_81 WHERE top_25 < 4 AND top_10 < 1


Instruction: How many patients of black/cape verdean ethnicity were primarily diagnosed with the disease colangitis

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

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

CREATE TABLE lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
)

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

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
)

Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "COLANGITIS"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many patients of black/cape verdean ethnicity were primarily diagnosed with the disease colangitis ### Input: CREATE TABLE procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

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

CREATE TABLE lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
)

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

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
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "COLANGITIS"