CREATE TABLE Person (name VARCHAR, age INT, city TEXT, gender TEXT, job TEXT)
CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR, year INT)

How many people are under 40 for each gender Plot them as bar chart, and could you show by the X in descending?
SELECT gender, COUNT(*) FROM Person WHERE age < 40 GROUP BY gender ORDER BY gender DESC
SELECT "gender", COUNT(*) FROM "Person" WHERE "age" < 40 GROUP BY "gender" ORDER BY "gender" DESC NULLS LAST