Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.

### Instruction:

Convert text to sql: Return the average and minimum age of captains in each class. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select avg ( _ ) , min ( _ ) , _ from _ group by _ | select avg ( age ) , min ( age ) , class from captain group by class