SQL Coding Practice
Practice typing real code syntax, including brackets, punctuation, and indentation. Snippets are for typing practice only and are never executed.
Join and group results
Type the code exactly. Tab inserts four spaces. Code is not executed.
Progress: 0%
Current mismatches: 0
SELECT
customers.name,
COUNT(orders.id) AS order_count
FROM customers
LEFT JOIN orders
ON orders.customer_id = customers.id
GROUP BY customers.id, customers.name
ORDER BY order_count DESC;
Type the code exactly, including spaces and indentation.