@Careerbuddha111 COUNT => SUM
also you can write it as a modern SQL
SELECT
customer_id,
SUM(1) FILTER (WHERE status = 'completed') as completed_orders
FROM orders
GROUP BY customer_id;
-- guess this would work too
count(*) filter (where status = 'completed')