Counting Customers by Country with COUNT Function
📖 Scenario: You work for a company that has customers from different countries. You want to find out how many customers are from each country.
🎯 Goal: Build a SQL query that uses the COUNT function to count the number of customers per country.
📋 What You'll Learn
Create a table called
customers with columns id, name, and country.Insert exactly 5 customers with specified names and countries.
Write a SQL query that counts customers grouped by
country using the COUNT function.Order the results by
country alphabetically.💡 Why This Matters
🌍 Real World
Counting customers by country helps businesses understand their market distribution and target marketing efforts.
💼 Career
Database analysts and developers often write queries with COUNT and GROUP BY to summarize data for reports.
Progress0 / 4 steps