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: Show different types of ships and the average tonnage of ships of each type. | mission : mission_id , ship_id , code , launched_year , location , speed_knots , fate | ship : ship_id , name , type , nationality , tonnage | mission.ship_id = ship.ship_id | 

### Response:

select _ , avg ( _ ) from _ group by _ | select type , avg ( tonnage ) from ship group by type