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)

A stacked bar graph shows the total number of captains categorize by ranks of different classes, could you list in ascending by the x-axis?
SELECT Class, COUNT(Class) FROM captain GROUP BY Rank, Class ORDER BY Class
SELECT "Class", COUNT("Class") FROM "captain" GROUP BY "Rank", "Class" ORDER BY "Class" NULLS FIRST