Count the number of captains younger than 50 of each rank.
CREATE TABLE ship (
    ship_id number,
    name text,
    type text,
    built_year number,
    class text,
    flag text
)

CREATE TABLE captain (
    captain_id number,
    name text,
    ship_id number,
    age text,
    class text,
    rank text
)
SELECT COUNT(*), rank FROM captain WHERE age < 50 GROUP BY rank
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 captains younger than 50 of each rank. ### Input: CREATE TABLE ship (
    ship_id number,
    name text,
    type text,
    built_year number,
    class text,
    flag text
)

CREATE TABLE captain (
    captain_id number,
    name text,
    ship_id number,
    age text,
    class text,
    rank text
) ### Response: SELECT COUNT(*), rank FROM captain WHERE age < 50 GROUP BY rank