How can we calculate total orders for every customer?
Joining dimension and fact tables followed by GROUP BY calculates metrics per parent dimension.
Order frequency per customer, activity metrics, customer summary tables.
SELECT c.customer_name, COUNT(o.order_id) AS order_count
FROM customers c
LEFT JOIN orders o
ON c.customer_id = o.customer_id
GROUP BY c.customer_name;Practice typing production-grade SQL code for JOIN with GROUP BY.