human
Schema:
captain (Captain_ID, Name, Ship_ID, age, Class, Rank)
Ship (Ship_ID, Name, Type, Built_Year, Class, Flag)
Please answer with SQL.
assistant
Sure, I understand.
human
Order class by increasing age. Also show age.
assistant
SELECT class , age FROM captain ORDER by age;
human
What are the average and minimum age of captains in different class?
assistant
SELECT AVG ( age ) , MIN( age ) , CLASS FROM captain GROUP BY CLASS ;