What detention types are there?
select detention_type_code from detention group by detention_type_code
How many detentions are there in terms of each type?
select detention_type_code, count(*) from detention group by detention_type_code
Show me the code and description of the least frequent one of them.
select t1.detention_type_code, t2.detention_type_description from detention as t1 join ref_detention_type as t2 on t1.detention_type_code = t2.detention_type_code group by t1.detention_type_code order by count(*) asc limit 1