How many draft copies does each document have? List the id of documents.
select document_id, count(*) from draft_copies group by document_id;
Which one has the maximum number of draft copies?
select document_id, count(*) from draft_copies group by document_id order by draft_number desc limit 1;
How about ones with more than 1 draft copies?
select document_id, count(*) from draft_copies group by document_id having count(*) > 1;