How about the location code with the least documents?
SELECT location_code FROM Document_locations GROUP BY location_code ORDER BY count ( * )  LIMIT 1
location code with the least documents refers to MIN(COUNT(document_id));