Instruction: Top 50 users from UAE.

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

CREATE TABLE VoteTypes (
    Id number,
    Name text
)

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

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

CREATE TABLE PostTypes (
    Id number,
    Name text
)

CREATE TABLE PostHistoryTypes (
    Id number,
    Name text
)

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

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

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

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

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

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

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

CREATE TABLE 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 PostHistory (
    Id number,
    PostHistoryTypeId number,
    PostId number,
    RevisionGUID other,
    CreationDate time,
    UserId number,
    UserDisplayName text,
    Comment text,
    Text text,
    ContentLicense text
)

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

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

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

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

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

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

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

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

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

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

CREATE TABLE PostTags (
    PostId number,
    TagId number
)

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

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

Response: SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%united arab emirates%' ORDER BY Reputation DESC LIMIT 150

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: Top 50 users from UAE. ### Input: CREATE TABLE TagSynonyms (
    Id number,
    SourceTagName text,
    TargetTagName text,
    CreationDate time,
    OwnerUserId number,
    AutoRenameCount number,
    LastAutoRename time,
    Score number,
    ApprovedByUserId number,
    ApprovalDate time
)

CREATE TABLE VoteTypes (
    Id number,
    Name text
)

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

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

CREATE TABLE PostTypes (
    Id number,
    Name text
)

CREATE TABLE PostHistoryTypes (
    Id number,
    Name text
)

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

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

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

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

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

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

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

CREATE TABLE 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 PostHistory (
    Id number,
    PostHistoryTypeId number,
    PostId number,
    RevisionGUID other,
    CreationDate time,
    UserId number,
    UserDisplayName text,
    Comment text,
    Text text,
    ContentLicense text
)

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

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

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

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

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

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

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

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

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

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

CREATE TABLE PostTags (
    PostId number,
    TagId number
)

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

CREATE TABLE CloseReasonTypes (
    Id number,
    Name text,
    Description 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
) ### Response: SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%united arab emirates%' ORDER BY Reputation DESC LIMIT 150


Instruction: tell me the name of the drug to which patient 007-849 was allergic in this hospital encounter?

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

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

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

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

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

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

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

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

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

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

Response: SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-849' AND patient.hospitaldischargetime IS NULL))

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: tell me the name of the drug to which patient 007-849 was allergic in this hospital encounter? ### Input: CREATE TABLE vitalperiodic (
    vitalperiodicid number,
    patientunitstayid number,
    temperature number,
    sao2 number,
    heartrate number,
    respiration number,
    systemicsystolic number,
    systemicdiastolic number,
    systemicmean number,
    observationtime time
)

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

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

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

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

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

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

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

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

CREATE TABLE lab (
    labid number,
    patientunitstayid number,
    labname text,
    labresult number,
    labresulttime time
) ### Response: SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-849' AND patient.hospitaldischargetime IS NULL))


Instruction: What place is South Africa?

Input:
CREATE TABLE table_44277 (
    "Place" text,
    "Player" text,
    "Country" text,
    "Score" text,
    "To par" text,
    "Money ( $ )" real
)

Response: SELECT "Place" FROM table_44277 WHERE "Country" = 'south africa'

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 place is South Africa? ### Input: CREATE TABLE table_44277 (
    "Place" text,
    "Player" text,
    "Country" text,
    "Score" text,
    "To par" text,
    "Money ( $ )" real
) ### Response: SELECT "Place" FROM table_44277 WHERE "Country" = 'south africa'


Instruction: What Date has a Result of l 21 34?

Input:
CREATE TABLE table_name_31 (
    date VARCHAR,
    result VARCHAR
)

Response: SELECT date FROM table_name_31 WHERE result = "l 21–34"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Date has a Result of l 21 34? ### Input: CREATE TABLE table_name_31 (
    date VARCHAR,
    result VARCHAR
) ### Response: SELECT date FROM table_name_31 WHERE result = "l 21–34"


Instruction: What is the largest lost stat when the difference is - 19?

Input:
CREATE TABLE table_7372 (
    "Position" real,
    "Team" text,
    "Points" real,
    "Played" real,
    "Drawn" real,
    "Lost" real,
    "Against" real,
    "Difference" text
)

Response: SELECT MAX("Lost") FROM table_7372 WHERE "Difference" = '- 19'

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 lost stat when the difference is - 19? ### Input: CREATE TABLE table_7372 (
    "Position" real,
    "Team" text,
    "Points" real,
    "Played" real,
    "Drawn" real,
    "Lost" real,
    "Against" real,
    "Difference" text
) ### Response: SELECT MAX("Lost") FROM table_7372 WHERE "Difference" = '- 19'


Instruction: Tell me the constructor for grid of 17

Input:
CREATE TABLE table_name_9 (
    constructor VARCHAR,
    grid VARCHAR
)

Response: SELECT constructor FROM table_name_9 WHERE grid = 17

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: Tell me the constructor for grid of 17 ### Input: CREATE TABLE table_name_9 (
    constructor VARCHAR,
    grid VARCHAR
) ### Response: SELECT constructor FROM table_name_9 WHERE grid = 17


Instruction: How big was the crowd of the Home team of Collingwood?

Input:
CREATE TABLE table_name_92 (
    crowd INTEGER,
    home_team VARCHAR
)

Response: SELECT MAX(crowd) FROM table_name_92 WHERE home_team = "collingwood"

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 big was the crowd of the Home team of Collingwood? ### Input: CREATE TABLE table_name_92 (
    crowd INTEGER,
    home_team VARCHAR
) ### Response: SELECT MAX(crowd) FROM table_name_92 WHERE home_team = "collingwood"


Instruction: Who is the leading scorer of the game on 13 February 2008?

Input:
CREATE TABLE table_name_52 (
    leading_scorer VARCHAR,
    date VARCHAR
)

Response: SELECT leading_scorer FROM table_name_52 WHERE date = "13 february 2008"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the leading scorer of the game on 13 February 2008? ### Input: CREATE TABLE table_name_52 (
    leading_scorer VARCHAR,
    date VARCHAR
) ### Response: SELECT leading_scorer FROM table_name_52 WHERE date = "13 february 2008"


Instruction: count the number of patients whose primary disease is morbid obesity/sda and year of death is less than or equal to 2183?

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

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

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

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

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

Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND demographic.dod_year <= "2183.0"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose primary disease is morbid obesity/sda and year of death is less than or equal to 2183? ### Input: CREATE TABLE procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

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

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

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

CREATE TABLE diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND demographic.dod_year <= "2183.0"


Instruction: What is the highest laps of the year when the rank was 14?

Input:
CREATE TABLE table_68142 (
    "Year" text,
    "Start" text,
    "Qual" text,
    "Rank" text,
    "Finish" text,
    "Laps" real
)

Response: SELECT MAX("Laps") FROM table_68142 WHERE "Rank" = '14'

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 laps of the year when the rank was 14? ### Input: CREATE TABLE table_68142 (
    "Year" text,
    "Start" text,
    "Qual" text,
    "Rank" text,
    "Finish" text,
    "Laps" real
) ### Response: SELECT MAX("Laps") FROM table_68142 WHERE "Rank" = '14'


Instruction: What day had a time of 29.816?

Input:
CREATE TABLE table_53907 (
    "Record" text,
    "Year" text,
    "Date" text,
    "Driver" text,
    "Car Make" text,
    "Time" text,
    "Average Speed (mph)" text
)

Response: SELECT "Date" FROM table_53907 WHERE "Time" = '29.816'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What day had a time of 29.816? ### Input: CREATE TABLE table_53907 (
    "Record" text,
    "Year" text,
    "Date" text,
    "Driver" text,
    "Car Make" text,
    "Time" text,
    "Average Speed (mph)" text
) ### Response: SELECT "Date" FROM table_53907 WHERE "Time" = '29.816'


Instruction: What series episode has deli meats under segment B?

Input:
CREATE TABLE table_name_98 (
    series_ep VARCHAR,
    segment_b VARCHAR
)

Response: SELECT series_ep FROM table_name_98 WHERE segment_b = "deli meats"

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 series episode has deli meats under segment B? ### Input: CREATE TABLE table_name_98 (
    series_ep VARCHAR,
    segment_b VARCHAR
) ### Response: SELECT series_ep FROM table_name_98 WHERE segment_b = "deli meats"


Instruction: What year was there no competition in Mixed Doubles?

Input:
CREATE TABLE table_15773 (
    "Year" text,
    "Men's singles" text,
    "Women's singles" text,
    "Men's doubles" text,
    "Women's doubles" text,
    "Mixed doubles" text
)

Response: SELECT "Year" FROM table_15773 WHERE "Mixed doubles" = 'no competition'

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 was there no competition in Mixed Doubles? ### Input: CREATE TABLE table_15773 (
    "Year" text,
    "Men's singles" text,
    "Women's singles" text,
    "Men's doubles" text,
    "Women's doubles" text,
    "Mixed doubles" text
) ### Response: SELECT "Year" FROM table_15773 WHERE "Mixed doubles" = 'no competition'


Instruction: For the game where the away team was North Melbourne, what was the venue?

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

Response: SELECT "Venue" FROM table_33381 WHERE "Away team" = 'north melbourne'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For the game where the away team was North Melbourne, what was the venue? ### Input: CREATE TABLE table_33381 (
    "Home team" text,
    "Home team score" text,
    "Away team" text,
    "Away team score" text,
    "Venue" text,
    "Crowd" real,
    "Date" text
) ### Response: SELECT "Venue" FROM table_33381 WHERE "Away team" = 'north melbourne'


Instruction: What was the home team score at Kardinia Park?

Input:
CREATE TABLE table_name_43 (
    home_team VARCHAR,
    venue VARCHAR
)

Response: SELECT home_team AS score FROM table_name_43 WHERE venue = "kardinia park"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the home team score at Kardinia Park? ### Input: CREATE TABLE table_name_43 (
    home_team VARCHAR,
    venue VARCHAR
) ### Response: SELECT home_team AS score FROM table_name_43 WHERE venue = "kardinia park"


Instruction: What is the most effortless class I can take to satisfy the MDE ?

Input:
CREATE TABLE area (
    course_id int,
    area varchar
)

CREATE TABLE program (
    program_id int,
    name varchar,
    college varchar,
    introduction varchar
)

CREATE TABLE course_prerequisite (
    pre_course_id int,
    course_id int
)

CREATE TABLE course_offering (
    offering_id int,
    course_id int,
    semester int,
    section_number int,
    start_time time,
    end_time time,
    monday varchar,
    tuesday varchar,
    wednesday varchar,
    thursday varchar,
    friday varchar,
    saturday varchar,
    sunday varchar,
    has_final_project varchar,
    has_final_exam varchar,
    textbook varchar,
    class_address varchar,
    allow_audit varchar
)

CREATE TABLE semester (
    semester_id int,
    semester varchar,
    year int
)

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

CREATE TABLE gsi (
    course_offering_id int,
    student_id int
)

CREATE TABLE program_course (
    program_id int,
    course_id int,
    workload int,
    category varchar
)

CREATE TABLE comment_instructor (
    instructor_id int,
    student_id int,
    score int,
    comment_text varchar
)

CREATE TABLE student_record (
    student_id int,
    course_id int,
    semester int,
    grade varchar,
    how varchar,
    transfer_source varchar,
    earn_credit varchar,
    repeat_term varchar,
    test_id varchar
)

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

CREATE TABLE course_tags_count (
    course_id int,
    clear_grading int,
    pop_quiz int,
    group_projects int,
    inspirational int,
    long_lectures int,
    extra_credit int,
    few_tests int,
    good_feedback int,
    tough_tests int,
    heavy_papers int,
    cares_for_students int,
    heavy_assignments int,
    respected int,
    participation int,
    heavy_reading int,
    tough_grader int,
    hilarious int,
    would_take_again int,
    good_lecture int,
    no_skip int
)

CREATE TABLE course (
    course_id int,
    name varchar,
    department varchar,
    number varchar,
    credits varchar,
    advisory_requirement varchar,
    enforced_requirement varchar,
    description varchar,
    num_semesters int,
    num_enrolled int,
    has_discussion varchar,
    has_lab varchar,
    has_projects varchar,
    has_exams varchar,
    num_reviews int,
    clarity_score int,
    easiness_score int,
    helpfulness_score int
)

CREATE TABLE student (
    student_id int,
    lastname varchar,
    firstname varchar,
    program_id int,
    declare_major varchar,
    total_credit int,
    total_gpa float,
    entered_as varchar,
    admit_term int,
    predicted_graduation_semester int,
    degree varchar,
    minor varchar,
    internship varchar
)

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

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

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

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

Response: SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%MDE%')

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 most effortless class I can take to satisfy the MDE ? ### Input: CREATE TABLE area (
    course_id int,
    area varchar
)

CREATE TABLE program (
    program_id int,
    name varchar,
    college varchar,
    introduction varchar
)

CREATE TABLE course_prerequisite (
    pre_course_id int,
    course_id int
)

CREATE TABLE course_offering (
    offering_id int,
    course_id int,
    semester int,
    section_number int,
    start_time time,
    end_time time,
    monday varchar,
    tuesday varchar,
    wednesday varchar,
    thursday varchar,
    friday varchar,
    saturday varchar,
    sunday varchar,
    has_final_project varchar,
    has_final_exam varchar,
    textbook varchar,
    class_address varchar,
    allow_audit varchar
)

CREATE TABLE semester (
    semester_id int,
    semester varchar,
    year int
)

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

CREATE TABLE gsi (
    course_offering_id int,
    student_id int
)

CREATE TABLE program_course (
    program_id int,
    course_id int,
    workload int,
    category varchar
)

CREATE TABLE comment_instructor (
    instructor_id int,
    student_id int,
    score int,
    comment_text varchar
)

CREATE TABLE student_record (
    student_id int,
    course_id int,
    semester int,
    grade varchar,
    how varchar,
    transfer_source varchar,
    earn_credit varchar,
    repeat_term varchar,
    test_id varchar
)

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

CREATE TABLE course_tags_count (
    course_id int,
    clear_grading int,
    pop_quiz int,
    group_projects int,
    inspirational int,
    long_lectures int,
    extra_credit int,
    few_tests int,
    good_feedback int,
    tough_tests int,
    heavy_papers int,
    cares_for_students int,
    heavy_assignments int,
    respected int,
    participation int,
    heavy_reading int,
    tough_grader int,
    hilarious int,
    would_take_again int,
    good_lecture int,
    no_skip int
)

CREATE TABLE course (
    course_id int,
    name varchar,
    department varchar,
    number varchar,
    credits varchar,
    advisory_requirement varchar,
    enforced_requirement varchar,
    description varchar,
    num_semesters int,
    num_enrolled int,
    has_discussion varchar,
    has_lab varchar,
    has_projects varchar,
    has_exams varchar,
    num_reviews int,
    clarity_score int,
    easiness_score int,
    helpfulness_score int
)

CREATE TABLE student (
    student_id int,
    lastname varchar,
    firstname varchar,
    program_id int,
    declare_major varchar,
    total_credit int,
    total_gpa float,
    entered_as varchar,
    admit_term int,
    predicted_graduation_semester int,
    degree varchar,
    minor varchar,
    internship varchar
)

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

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

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

CREATE TABLE offering_instructor (
    offering_instructor_id int,
    offering_id int,
    instructor_id int
) ### Response: SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%MDE%')


Instruction: What year was the player with the height 2.04 born?

Input:
CREATE TABLE table_12962773_12 (
    year_born INTEGER,
    height VARCHAR
)

Response: SELECT MIN(year_born) FROM table_12962773_12 WHERE height = "2.04"

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 was the player with the height 2.04 born? ### Input: CREATE TABLE table_12962773_12 (
    year_born INTEGER,
    height VARCHAR
) ### Response: SELECT MIN(year_born) FROM table_12962773_12 WHERE height = "2.04"


Instruction: What number pick was the player with the hometown school of concordia college?

Input:
CREATE TABLE table_name_96 (
    pick VARCHAR,
    hometown_school VARCHAR
)

Response: SELECT pick FROM table_name_96 WHERE hometown_school = "concordia college"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What number pick was the player with the hometown school of concordia college? ### Input: CREATE TABLE table_name_96 (
    pick VARCHAR,
    hometown_school VARCHAR
) ### Response: SELECT pick FROM table_name_96 WHERE hometown_school = "concordia college"


Instruction: Which rank has a more than 0 silver, 4 bronze, and a total smaller than 10?

Input:
CREATE TABLE table_name_34 (
    rank INTEGER,
    total VARCHAR,
    silver VARCHAR,
    bronze VARCHAR
)

Response: SELECT SUM(rank) FROM table_name_34 WHERE silver > 0 AND bronze = 4 AND total < 10

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which rank has a more than 0 silver, 4 bronze, and a total smaller than 10? ### Input: CREATE TABLE table_name_34 (
    rank INTEGER,
    total VARCHAR,
    silver VARCHAR,
    bronze VARCHAR
) ### Response: SELECT SUM(rank) FROM table_name_34 WHERE silver > 0 AND bronze = 4 AND total < 10


Instruction: Which FCC info has an ERP W of 100 watts?

Input:
CREATE TABLE table_75667 (
    "Call sign" text,
    "Frequency MHz" text,
    "City of license" text,
    "ERP W" text,
    "FCC info" text
)

Response: SELECT "FCC info" FROM table_75667 WHERE "ERP W" = '100 watts'

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 FCC info has an ERP W of 100 watts? ### Input: CREATE TABLE table_75667 (
    "Call sign" text,
    "Frequency MHz" text,
    "City of license" text,
    "ERP W" text,
    "FCC info" text
) ### Response: SELECT "FCC info" FROM table_75667 WHERE "ERP W" = '100 watts'


Instruction: What position does the saint louis player play?

Input:
CREATE TABLE table_name_39 (
    position VARCHAR,
    college VARCHAR
)

Response: SELECT position FROM table_name_39 WHERE college = "saint louis"

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 position does the saint louis player play? ### Input: CREATE TABLE table_name_39 (
    position VARCHAR,
    college VARCHAR
) ### Response: SELECT position FROM table_name_39 WHERE college = "saint louis"


Instruction: Name the total points for 2

Input:
CREATE TABLE table_27496841_3 (
    total_points VARCHAR,
    place VARCHAR
)

Response: SELECT total_points FROM table_27496841_3 WHERE place = 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: Name the total points for 2 ### Input: CREATE TABLE table_27496841_3 (
    total_points VARCHAR,
    place VARCHAR
) ### Response: SELECT total_points FROM table_27496841_3 WHERE place = 2


Instruction: What medal was awarded in the men's freestyle 52 kg?

Input:
CREATE TABLE table_35155 (
    "Medal" text,
    "Name" text,
    "Games" text,
    "Sport" text,
    "Event" text
)

Response: SELECT "Medal" FROM table_35155 WHERE "Event" = 'men''s freestyle 52 kg'

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 medal was awarded in the men's freestyle 52 kg? ### Input: CREATE TABLE table_35155 (
    "Medal" text,
    "Name" text,
    "Games" text,
    "Sport" text,
    "Event" text
) ### Response: SELECT "Medal" FROM table_35155 WHERE "Event" = 'men''s freestyle 52 kg'


Instruction: When the away team was geelong, what was the away team score?

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

Response: SELECT "Away team score" FROM table_10951 WHERE "Away team" = 'geelong'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the away team was geelong, what was the away team score? ### Input: CREATE TABLE table_10951 (
    "Home team" text,
    "Home team score" text,
    "Away team" text,
    "Away team score" text,
    "Venue" text,
    "Crowd" real,
    "Date" text
) ### Response: SELECT "Away team score" FROM table_10951 WHERE "Away team" = 'geelong'


Instruction: Name the number of events for 3031

Input:
CREATE TABLE table_26589 (
    "#" real,
    "Player" text,
    "Country" text,
    "Points" real,
    "Reset points" real,
    "Events" real
)

Response: SELECT COUNT("Events") FROM table_26589 WHERE "Points" = '3031'

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 number of events for 3031 ### Input: CREATE TABLE table_26589 (
    "#" real,
    "Player" text,
    "Country" text,
    "Points" real,
    "Reset points" real,
    "Events" real
) ### Response: SELECT COUNT("Events") FROM table_26589 WHERE "Points" = '3031'


Instruction: for how long did the patient id 8323 remain admitted in hospital? also specify death status

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

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

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

CREATE TABLE 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 demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "8323"

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 how long did the patient id 8323 remain admitted in hospital? also specify death status ### Input: CREATE TABLE procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

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

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

CREATE TABLE 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 demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "8323"


Instruction: Which venue had an opponent of Sunderland and a result of a 1-1 draw?

Input:
CREATE TABLE table_63248 (
    "Date" text,
    "Opponent" text,
    "Venue" text,
    "Result" text,
    "Attendance" real
)

Response: SELECT "Venue" FROM table_63248 WHERE "Opponent" = 'sunderland' AND "Result" = '1-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: Which venue had an opponent of Sunderland and a result of a 1-1 draw? ### Input: CREATE TABLE table_63248 (
    "Date" text,
    "Opponent" text,
    "Venue" text,
    "Result" text,
    "Attendance" real
) ### Response: SELECT "Venue" FROM table_63248 WHERE "Opponent" = 'sunderland' AND "Result" = '1-1'


Instruction: name the player for number 5

Input:
CREATE TABLE table_26229 (
    "No" real,
    "Player" text,
    "Height (m)" text,
    "Height (f)" text,
    "Position" text,
    "Year born" real,
    "Current Club" text
)

Response: SELECT "Player" FROM table_26229 WHERE "No" = '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: name the player for number 5 ### Input: CREATE TABLE table_26229 (
    "No" real,
    "Player" text,
    "Height (m)" text,
    "Height (f)" text,
    "Position" text,
    "Year born" real,
    "Current Club" text
) ### Response: SELECT "Player" FROM table_26229 WHERE "No" = '5'


Instruction: What is the country of Palmers Shipbuilding and Iron Company?

Input:
CREATE TABLE table_13011 (
    "Country" text,
    "Builder" text,
    "Location" text,
    "Ship" text,
    "Class / type" text
)

Response: SELECT "Country" FROM table_13011 WHERE "Builder" = 'palmers shipbuilding and iron company'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the country of Palmers Shipbuilding and Iron Company? ### Input: CREATE TABLE table_13011 (
    "Country" text,
    "Builder" text,
    "Location" text,
    "Ship" text,
    "Class / type" text
) ### Response: SELECT "Country" FROM table_13011 WHERE "Builder" = 'palmers shipbuilding and iron company'


Instruction: What is the Pick # with an Overall of 19?

Input:
CREATE TABLE table_36615 (
    "Round" real,
    "Pick #" real,
    "Overall" real,
    "Name" text,
    "Position" text,
    "College" text
)

Response: SELECT MAX("Pick #") FROM table_36615 WHERE "Overall" = '19'

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 Pick # with an Overall of 19? ### Input: CREATE TABLE table_36615 (
    "Round" real,
    "Pick #" real,
    "Overall" real,
    "Name" text,
    "Position" text,
    "College" text
) ### Response: SELECT MAX("Pick #") FROM table_36615 WHERE "Overall" = '19'


Instruction: Who is the perpetrator in Bait Al-Aqari?

Input:
CREATE TABLE table_12652 (
    "Perpetrator" text,
    "Year" text,
    "Location" text,
    "Country" text,
    "Killed" text
)

Response: SELECT "Perpetrator" FROM table_12652 WHERE "Location" = 'bait al-aqari'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the perpetrator in Bait Al-Aqari? ### Input: CREATE TABLE table_12652 (
    "Perpetrator" text,
    "Year" text,
    "Location" text,
    "Country" text,
    "Killed" text
) ### Response: SELECT "Perpetrator" FROM table_12652 WHERE "Location" = 'bait al-aqari'


Instruction: What's the Uni# of Timms, who has bats of R?

Input:
CREATE TABLE table_name_22 (
    uni_number VARCHAR,
    bats VARCHAR,
    surname VARCHAR
)

Response: SELECT uni_number FROM table_name_22 WHERE bats = "r" AND surname = "timms"

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 Uni# of Timms, who has bats of R? ### Input: CREATE TABLE table_name_22 (
    uni_number VARCHAR,
    bats VARCHAR,
    surname VARCHAR
) ### Response: SELECT uni_number FROM table_name_22 WHERE bats = "r" AND surname = "timms"


Instruction: What is Score, when Place is 'T8', and when Player is 'Orville Moody'?

Input:
CREATE TABLE table_name_40 (
    score VARCHAR,
    place VARCHAR,
    player VARCHAR
)

Response: SELECT score FROM table_name_40 WHERE place = "t8" AND player = "orville moody"

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 Score, when Place is 'T8', and when Player is 'Orville Moody'? ### Input: CREATE TABLE table_name_40 (
    score VARCHAR,
    place VARCHAR,
    player VARCHAR
) ### Response: SELECT score FROM table_name_40 WHERE place = "t8" AND player = "orville moody"


Instruction: What are the descriptions for the aircrafts, and count them by a bar chart

Input:
CREATE TABLE airport_aircraft (
    ID int,
    Airport_ID int,
    Aircraft_ID int
)

CREATE TABLE pilot (
    Pilot_Id int(11),
    Name varchar(50),
    Age int(11)
)

CREATE TABLE match (
    Round real,
    Location text,
    Country text,
    Date text,
    Fastest_Qualifying text,
    Winning_Pilot text,
    Winning_Aircraft text
)

CREATE TABLE airport (
    Airport_ID int,
    Airport_Name text,
    Total_Passengers real,
    %_Change_2007 text,
    International_Passengers real,
    Domestic_Passengers real,
    Transit_Passengers real,
    Aircraft_Movements real,
    Freight_Metric_Tonnes real
)

CREATE TABLE aircraft (
    Aircraft_ID int(11),
    Aircraft varchar(50),
    Description varchar(50),
    Max_Gross_Weight varchar(50),
    Total_disk_area varchar(50),
    Max_disk_Loading varchar(50)
)

Response: SELECT Description, COUNT(Description) FROM aircraft GROUP BY Description

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 descriptions for the aircrafts, and count them by a bar chart ### Input: CREATE TABLE airport_aircraft (
    ID int,
    Airport_ID int,
    Aircraft_ID int
)

CREATE TABLE pilot (
    Pilot_Id int(11),
    Name varchar(50),
    Age int(11)
)

CREATE TABLE match (
    Round real,
    Location text,
    Country text,
    Date text,
    Fastest_Qualifying text,
    Winning_Pilot text,
    Winning_Aircraft text
)

CREATE TABLE airport (
    Airport_ID int,
    Airport_Name text,
    Total_Passengers real,
    %_Change_2007 text,
    International_Passengers real,
    Domestic_Passengers real,
    Transit_Passengers real,
    Aircraft_Movements real,
    Freight_Metric_Tonnes real
)

CREATE TABLE aircraft (
    Aircraft_ID int(11),
    Aircraft varchar(50),
    Description varchar(50),
    Max_Gross_Weight varchar(50),
    Total_disk_area varchar(50),
    Max_disk_Loading varchar(50)
) ### Response: SELECT Description, COUNT(Description) FROM aircraft GROUP BY Description


Instruction: What is the Name with an Opened (closing date if defunct) of 1995 and has a Length of miles (m), in Illinois?

Input:
CREATE TABLE table_35745 (
    "Name" text,
    "Location" text,
    "State" text,
    "Opened (closing date if defunct)" text,
    "Surface" text,
    "Length" text
)

Response: SELECT "Name" FROM table_35745 WHERE "Opened (closing date if defunct)" = '1995' AND "Length" = 'miles (m)' AND "State" = 'illinois'

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 with an Opened (closing date if defunct) of 1995 and has a Length of miles (m), in Illinois? ### Input: CREATE TABLE table_35745 (
    "Name" text,
    "Location" text,
    "State" text,
    "Opened (closing date if defunct)" text,
    "Surface" text,
    "Length" text
) ### Response: SELECT "Name" FROM table_35745 WHERE "Opened (closing date if defunct)" = '1995' AND "Length" = 'miles (m)' AND "State" = 'illinois'


Instruction: Find the number of patients who were transferred within this facility and were born before the year 2150.

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

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

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

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

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

Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "2150"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of patients who were transferred within this facility and were born before the year 2150. ### Input: CREATE TABLE diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

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

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

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

CREATE TABLE prescriptions (
    subject_id text,
    hadm_id text,
    icustay_id text,
    drug_type text,
    drug text,
    formulary_drug_cd text,
    route text,
    drug_dose text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "2150"


Instruction: Name the nation when bronze is less than 4 and the total is more than 4

Input:
CREATE TABLE table_name_46 (
    nation VARCHAR,
    total VARCHAR,
    bronze VARCHAR
)

Response: SELECT nation FROM table_name_46 WHERE total > 4 AND bronze < 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: Name the nation when bronze is less than 4 and the total is more than 4 ### Input: CREATE TABLE table_name_46 (
    nation VARCHAR,
    total VARCHAR,
    bronze VARCHAR
) ### Response: SELECT nation FROM table_name_46 WHERE total > 4 AND bronze < 4


Instruction: On what date was Mike Jackson a handler at the Indianapolis Boat, Sport & Travel Show?

Input:
CREATE TABLE table_51074 (
    "Date" text,
    "Distance" text,
    "Handler" text,
    "Event" text,
    "Location" text
)

Response: SELECT "Date" FROM table_51074 WHERE "Handler" = 'mike jackson' AND "Event" = 'indianapolis boat, sport & travel show'

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: On what date was Mike Jackson a handler at the Indianapolis Boat, Sport & Travel Show? ### Input: CREATE TABLE table_51074 (
    "Date" text,
    "Distance" text,
    "Handler" text,
    "Event" text,
    "Location" text
) ### Response: SELECT "Date" FROM table_51074 WHERE "Handler" = 'mike jackson' AND "Event" = 'indianapolis boat, sport & travel show'


Instruction: For the Venue of western oval, what's the Away team playing?

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

Response: SELECT "Away team" FROM table_54575 WHERE "Venue" = 'western oval'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For the Venue of western oval, what's the Away team playing? ### Input: CREATE TABLE table_54575 (
    "Home team" text,
    "Home team score" text,
    "Away team" text,
    "Away team score" text,
    "Venue" text,
    "Crowd" real,
    "Date" text
) ### Response: SELECT "Away team" FROM table_54575 WHERE "Venue" = 'western oval'


Instruction: what are the top four common diagnoses that patients were diagnosed with within the same hospital visit after having been diagnosed with thrombocytopenia - alcohol-related since 2105?

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

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

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

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

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

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

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

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

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

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

Response: SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'thrombocytopenia - alcohol-related' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosisname, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.diagnosistime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid GROUP BY t2.diagnosisname) AS t3 WHERE t3.c1 <= 4

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the top four common diagnoses that patients were diagnosed with within the same hospital visit after having been diagnosed with thrombocytopenia - alcohol-related since 2105? ### Input: CREATE TABLE microlab (
    microlabid number,
    patientunitstayid number,
    culturesite text,
    organism text,
    culturetakentime time
)

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

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

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

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

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

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

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

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

CREATE TABLE intakeoutput (
    intakeoutputid number,
    patientunitstayid number,
    cellpath text,
    celllabel text,
    cellvaluenumeric number,
    intakeoutputtime time
) ### Response: SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'thrombocytopenia - alcohol-related' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosisname, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.diagnosistime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid GROUP BY t2.diagnosisname) AS t3 WHERE t3.c1 <= 4


Instruction: Name the number of direction for debrecen

Input:
CREATE TABLE table_23211 (
    "Further Cities" text,
    "County, Oblast or State" text,
    "Country" text,
    "Distance" text,
    "Direction" text
)

Response: SELECT COUNT("Direction") FROM table_23211 WHERE "Further Cities" = 'Debrecen'

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 number of direction for debrecen ### Input: CREATE TABLE table_23211 (
    "Further Cities" text,
    "County, Oblast or State" text,
    "Country" text,
    "Distance" text,
    "Direction" text
) ### Response: SELECT COUNT("Direction") FROM table_23211 WHERE "Further Cities" = 'Debrecen'


Instruction: when does the train departuring at 11.35 arrive

Input:
CREATE TABLE table_18333678_2 (
    arrival VARCHAR,
    departure VARCHAR
)

Response: SELECT arrival FROM table_18333678_2 WHERE departure = "11.35"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when does the train departuring at 11.35 arrive ### Input: CREATE TABLE table_18333678_2 (
    arrival VARCHAR,
    departure VARCHAR
) ### Response: SELECT arrival FROM table_18333678_2 WHERE departure = "11.35"


Instruction: what is the minimum stage where mountains classification is aitor osa and aitor gonz lez won?

Input:
CREATE TABLE table_19858 (
    "Stage" real,
    "Winner" text,
    "General classification" text,
    "Points classification" text,
    "Mountains classification" text,
    "Combination classification" text,
    "Team classification" text
)

Response: SELECT MIN("Stage") FROM table_19858 WHERE "Mountains classification" = 'Aitor Osa' AND "Winner" = 'Aitor González'

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 minimum stage where mountains classification is aitor osa and aitor gonz lez won? ### Input: CREATE TABLE table_19858 (
    "Stage" real,
    "Winner" text,
    "General classification" text,
    "Points classification" text,
    "Mountains classification" text,
    "Combination classification" text,
    "Team classification" text
) ### Response: SELECT MIN("Stage") FROM table_19858 WHERE "Mountains classification" = 'Aitor Osa' AND "Winner" = 'Aitor González'


Instruction: What was the time of the games that took place at the cassell coliseum blacksburg, va?

Input:
CREATE TABLE table_74398 (
    "Date" text,
    "Time" text,
    "ACC Team" text,
    "Big Ten Team" text,
    "Location" text,
    "Television" text,
    "Attendance" real,
    "Winner" text,
    "Challenge Leader" text
)

Response: SELECT "Time" FROM table_74398 WHERE "Location" = 'Cassell Coliseum • Blacksburg, VA'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the time of the games that took place at the cassell coliseum blacksburg, va? ### Input: CREATE TABLE table_74398 (
    "Date" text,
    "Time" text,
    "ACC Team" text,
    "Big Ten Team" text,
    "Location" text,
    "Television" text,
    "Attendance" real,
    "Winner" text,
    "Challenge Leader" text
) ### Response: SELECT "Time" FROM table_74398 WHERE "Location" = 'Cassell Coliseum • Blacksburg, VA'


Instruction: Who was the writer in the episode directed by Jesse Peretz?

Input:
CREATE TABLE table_3683 (
    "No. in series" real,
    "No. in season" real,
    "Title" text,
    "Directed by" text,
    "Written by" text,
    "Original air date" text,
    "U.S. viewers (million)" text
)

Response: SELECT "Written by" FROM table_3683 WHERE "Directed by" = 'Jesse Peretz'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the writer in the episode directed by Jesse Peretz? ### Input: CREATE TABLE table_3683 (
    "No. in series" real,
    "No. in season" real,
    "Title" text,
    "Directed by" text,
    "Written by" text,
    "Original air date" text,
    "U.S. viewers (million)" text
) ### Response: SELECT "Written by" FROM table_3683 WHERE "Directed by" = 'Jesse Peretz'


Instruction: What time span is listed under years for the 96th congres?

Input:
CREATE TABLE table_4022 (
    "Representative" text,
    "Party" text,
    "Years" text,
    "Congress" text,
    "District Home" text,
    "Occupation" text,
    "Electoral history" text
)

Response: SELECT "Years" FROM table_4022 WHERE "Congress" = '96th'

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 time span is listed under years for the 96th congres? ### Input: CREATE TABLE table_4022 (
    "Representative" text,
    "Party" text,
    "Years" text,
    "Congress" text,
    "District Home" text,
    "Occupation" text,
    "Electoral history" text
) ### Response: SELECT "Years" FROM table_4022 WHERE "Congress" = '96th'


Instruction: compared to last measured on the first hospital visit is chloride of patient 97121 less than second to last measured on the first hospital visit?

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

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

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

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

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

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

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

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

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

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

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

CREATE TABLE 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 procedures_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

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

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

Response: SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97121 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride') ORDER BY labevents.charttime DESC LIMIT 1) < (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97121 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride') ORDER BY labevents.charttime DESC LIMIT 1 OFFSET 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: compared to last measured on the first hospital visit is chloride of patient 97121 less than second to last measured on the first hospital visit? ### Input: CREATE TABLE d_icd_procedures (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

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

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

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

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

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

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

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

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

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

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

CREATE TABLE 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 procedures_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

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

CREATE TABLE d_items (
    row_id number,
    itemid number,
    label text,
    linksto 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 microbiologyevents (
    row_id number,
    subject_id number,
    hadm_id number,
    charttime time,
    spec_type_desc text,
    org_name text
) ### Response: SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97121 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride') ORDER BY labevents.charttime DESC LIMIT 1) < (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97121 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride') ORDER BY labevents.charttime DESC LIMIT 1 OFFSET 1)


Instruction: how many patients stayed in hospital for more than 34 days and were procedured with icd9 code 3931?

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 prescriptions (
    subject_id text,
    hadm_id text,
    icustay_id text,
    drug_type text,
    drug text,
    formulary_drug_cd text,
    route text,
    drug_dose text
)

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

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

Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "34" AND procedures.icd9_code = "3931"

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 stayed in hospital for more than 34 days and were procedured with icd9 code 3931? ### 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 prescriptions (
    subject_id text,
    hadm_id text,
    icustay_id text,
    drug_type text,
    drug text,
    formulary_drug_cd text,
    route text,
    drug_dose text
)

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

CREATE TABLE demographic (
    subject_id text,
    hadm_id text,
    name text,
    marital_status text,
    age text,
    dob text,
    gender text,
    language text,
    religion text,
    admission_type text,
    days_stay text,
    insurance text,
    ethnicity text,
    expire_flag text,
    admission_location text,
    discharge_location text,
    diagnosis text,
    dod text,
    dob_year text,
    dod_year text,
    admittime text,
    dischtime text,
    admityear text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "34" AND procedures.icd9_code = "3931"


Instruction: Take the average of the school enrollment.

Input:
CREATE TABLE school_details (
    school_id number,
    nickname text,
    colors text,
    league text,
    class text,
    division text
)

CREATE TABLE school (
    school_id number,
    school text,
    location text,
    enrollment number,
    founded number,
    denomination text,
    boys_or_girls text,
    day_or_boarding text,
    year_entered_competition number,
    school_colors text
)

CREATE TABLE player (
    player_id number,
    player text,
    team text,
    age number,
    position text,
    school_id number
)

CREATE TABLE school_performance (
    school_id number,
    school_year text,
    class_a text,
    class_aa text
)

Response: SELECT AVG(enrollment) FROM school

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: Take the average of the school enrollment. ### Input: CREATE TABLE school_details (
    school_id number,
    nickname text,
    colors text,
    league text,
    class text,
    division text
)

CREATE TABLE school (
    school_id number,
    school text,
    location text,
    enrollment number,
    founded number,
    denomination text,
    boys_or_girls text,
    day_or_boarding text,
    year_entered_competition number,
    school_colors text
)

CREATE TABLE player (
    player_id number,
    player text,
    team text,
    age number,
    position text,
    school_id number
)

CREATE TABLE school_performance (
    school_id number,
    school_year text,
    class_a text,
    class_aa text
) ### Response: SELECT AVG(enrollment) FROM school


Instruction: what was patient 025-44495's first sputum, tracheal specimen microbiology test time since 09/2105.

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

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

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

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

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

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

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

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

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

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

Response: SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND microlab.culturesite = 'sputum, tracheal specimen' AND STRFTIME('%y-%m', microlab.culturetakentime) >= '2105-09' ORDER BY microlab.culturetakentime LIMIT 1

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was patient 025-44495's first sputum, tracheal specimen microbiology test time since 09/2105. ### Input: CREATE TABLE treatment (
    treatmentid number,
    patientunitstayid number,
    treatmentname text,
    treatmenttime time
)

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

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

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

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

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

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

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

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

CREATE TABLE vitalperiodic (
    vitalperiodicid number,
    patientunitstayid number,
    temperature number,
    sao2 number,
    heartrate number,
    respiration number,
    systemicsystolic number,
    systemicdiastolic number,
    systemicmean number,
    observationtime time
) ### Response: SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND microlab.culturesite = 'sputum, tracheal specimen' AND STRFTIME('%y-%m', microlab.culturetakentime) >= '2105-09' ORDER BY microlab.culturetakentime LIMIT 1


Instruction: Which home team played against the away team Carlton?

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

Response: SELECT "Home team" FROM table_56902 WHERE "Away team" = 'carlton'

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 home team played against the away team Carlton? ### Input: CREATE TABLE table_56902 (
    "Home team" text,
    "Home team score" text,
    "Away team" text,
    "Away team score" text,
    "Venue" text,
    "Crowd" real,
    "Date" text
) ### Response: SELECT "Home team" FROM table_56902 WHERE "Away team" = 'carlton'


Instruction: What TV network is the series aistr em aired on?

Input:
CREATE TABLE table_name_21 (
    tv_network_s_ VARCHAR,
    alternate_title_translation VARCHAR
)

Response: SELECT tv_network_s_ FROM table_name_21 WHERE alternate_title_translation = "aistrų žemė"

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 TV network is the series aistr em aired on? ### Input: CREATE TABLE table_name_21 (
    tv_network_s_ VARCHAR,
    alternate_title_translation VARCHAR
) ### Response: SELECT tv_network_s_ FROM table_name_21 WHERE alternate_title_translation = "aistrų žemė"


Instruction: what is november 3 when june 10-11 is june 10, 1964?

Input:
CREATE TABLE table_25355392_2 (
    november_3 VARCHAR,
    june_10_11 VARCHAR
)

Response: SELECT november_3 FROM table_25355392_2 WHERE june_10_11 = "June 10, 1964"

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 november 3 when june 10-11 is june 10, 1964? ### Input: CREATE TABLE table_25355392_2 (
    november_3 VARCHAR,
    june_10_11 VARCHAR
) ### Response: SELECT november_3 FROM table_25355392_2 WHERE june_10_11 = "June 10, 1964"


Instruction: when did patient 027-149724 get for the last time a lab test since 29 months ago?

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

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

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

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

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

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

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

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

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

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

Response: SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-149724')) AND DATETIME(lab.labresulttime) >= DATETIME(CURRENT_TIME(), '-29 month') ORDER BY lab.labresulttime DESC LIMIT 1

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 027-149724 get for the last time a lab test since 29 months ago? ### Input: CREATE TABLE intakeoutput (
    intakeoutputid number,
    patientunitstayid number,
    cellpath text,
    celllabel text,
    cellvaluenumeric number,
    intakeoutputtime time
)

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

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

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

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

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

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

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

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

CREATE TABLE patient (
    uniquepid text,
    patienthealthsystemstayid number,
    patientunitstayid number,
    gender text,
    age text,
    ethnicity text,
    hospitalid number,
    wardid number,
    admissionheight number,
    admissionweight number,
    dischargeweight number,
    hospitaladmittime time,
    hospitaladmitsource text,
    unitadmittime time,
    unitdischargetime time,
    hospitaldischargetime time,
    hospitaldischargestatus text
) ### Response: SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-149724')) AND DATETIME(lab.labresulttime) >= DATETIME(CURRENT_TIME(), '-29 month') ORDER BY lab.labresulttime DESC LIMIT 1


Instruction: What is the title for the Korean progran on KBS2?

Input:
CREATE TABLE table_47993 (
    "Year" real,
    "Network" text,
    "Title" text,
    "Notes" text,
    "Language" text
)

Response: SELECT "Title" FROM table_47993 WHERE "Language" = 'korean' AND "Network" = 'kbs2'

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 title for the Korean progran on KBS2? ### Input: CREATE TABLE table_47993 (
    "Year" real,
    "Network" text,
    "Title" text,
    "Notes" text,
    "Language" text
) ### Response: SELECT "Title" FROM table_47993 WHERE "Language" = 'korean' AND "Network" = 'kbs2'


Instruction: Who is the professional partner of celebrity ma gorzata foremniak with a season less than 7, an average greater than 34.66, and a rank less than 10?

Input:
CREATE TABLE table_name_52 (
    professional_partner VARCHAR,
    celebrity VARCHAR,
    rank VARCHAR,
    season VARCHAR,
    average VARCHAR
)

Response: SELECT professional_partner FROM table_name_52 WHERE season < 7 AND average > 34.66 AND rank < 10 AND celebrity = "małgorzata foremniak"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the professional partner of celebrity ma gorzata foremniak with a season less than 7, an average greater than 34.66, and a rank less than 10? ### Input: CREATE TABLE table_name_52 (
    professional_partner VARCHAR,
    celebrity VARCHAR,
    rank VARCHAR,
    season VARCHAR,
    average VARCHAR
) ### Response: SELECT professional_partner FROM table_name_52 WHERE season < 7 AND average > 34.66 AND rank < 10 AND celebrity = "małgorzata foremniak"