Show the type code for all documents.
select document_type_code from documents
For each of the codes, also count the number of documents.
select document_type_code, count(*) from documents group by document_type_code
Which codes have fewer than 3 documents?
select document_type_code from documents group by document_type_code having count(*) < 3