U wilt dit doen:
SELECT categories.id, max(categories.slug), count(categories_questions.id) AS numberOfQuestions
FROM categories
LEFT JOIN categories_questions
ON categories.id = categories_questions.category_id
group by categories.id
De LEFT JOIN
zal ervoor zorgen dat categorieën zonder vragen worden vermeld met count =0