CREATE TABLE captain (Captain_ID INT, Name TEXT, Ship_ID INT, age TEXT, Class TEXT, Rank TEXT)
CREATE TABLE Ship (Ship_ID INT, Name TEXT, Type TEXT, Built_Year FLOAT, Class TEXT, Flag TEXT)

Plot the average of age by grouped by class as a bar graph, and show in desc by the total number.
SELECT Class, AVG(age) FROM captain GROUP BY Class ORDER BY AVG(age) DESC
SELECT "Class", AVG("age") FROM "captain" GROUP BY "Class" ORDER BY AVG("age") DESC NULLS LAST