客户数量
您需要为一次演示准备客户数量的整体概览。
本练习是课程的一部分
用 SQL 进行数据驱动决策
练习说明
- 生成一张表,包含客户总数、各国家的客户数,以及各国家中女性与男性客户的数量。
- 按国家和性别对结果排序。
交互式实操练习
通过完成这段示例代码来试试这个练习。
-- Count the total number of customers, the number of customers for each country, and the number of female and male customers for each country
SELECT country,
gender,
COUNT(*)
FROM customers
___ (___, ___)
___ ___, ___; -- Order the result by country and gender