Find the number of people who is under 40 for each gender, sort from high to low by the the total number .
CREATE TABLE Person (
    name varchar(20),
    age INTEGER,
    city TEXT,
    gender TEXT,
    job TEXT
)

CREATE TABLE PersonFriend (
    name varchar(20),
    friend varchar(20),
    year INTEGER
)
SELECT gender, COUNT(*) FROM Person WHERE age < 40 GROUP BY gender ORDER BY COUNT(*) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of people who is under 40 for each gender, sort from high to low by the the total number . ### Input: CREATE TABLE Person (
    name varchar(20),
    age INTEGER,
    city TEXT,
    gender TEXT,
    job TEXT
)

CREATE TABLE PersonFriend (
    name varchar(20),
    friend varchar(20),
    year INTEGER
) ### Response: SELECT gender, COUNT(*) FROM Person WHERE age < 40 GROUP BY gender ORDER BY COUNT(*) DESC