Description:
Customers by Country (chinook database)
The dataset you're working with represents a digital media store. You'll find information about artists, albums, tracks, media types, genres, playlists, invoices, customers, and employees.
Instructions
Carefully read through the challenge requirements.
Stick strictly to the column and table names provided in the Chinook database schema.
Always use double quotes for table and column names to avoid potential issues.
After constructing your SQL query, test it to ensure it works as expected.
Once you're confident in your solution, submit it for evaluation.
Challenges
Objective:
Determine the number of customers from each country.
Description:
Write an SQL query that counts the number of customers from each country. You should group the results by Country and order them alphabetically by Country.
Tables Used:
Customer
Expected Columns in Output:
Country
CustomerCount (this should represent the count of customers for each country)
Hints/Tips:
Make sure to use the COUNT function and the GROUP BY clause.
When writing your query, make sure to name the count column as CustomerCount.
Use double quotes around column names, for example: "Country".
Your result should be ordered by Country.
Challenge:
Count and list customers by country.
Query:
SELECT country, count(*) as CustomerCount FROM 'Customer' group by
country order by country asc;
#codedamn #challenge #solution #sql #day21 #query
Share this link via
Or copy link




































