Database: document_management

Question: Find the average access count of documents with the least popular structure.
SQL: SELECT avg(access_count) FROM documents GROUP BY document_structure_code ORDER BY count(*) ASC LIMIT 1

Question: List all the image name and URLs in the order of their names.
SQL: SELECT image_name ,  image_url FROM images ORDER BY image_name

Question: Find the number of users in each role.
SQL: SELECT count(*) ,  role_code FROM users GROUP BY role_code