Show customer buying activity per billing country: how many distinct customers bought, and the first/last invoice dates in that country.
| Column | Type |
|---|---|
| InvoiceId | INTEGER (PK) |
| CustomerId | INTEGER (FK) |
| InvoiceDate | TIMESTAMP NOT NULL |
| BillingCountry | TEXT |
| Total | NUMERIC(10,2) NOT NULL |
BillingCountryBillingCountry, CustomerCount (distinct CustomerId), FirstInvoice (date only), LastInvoice (date only), Span = LastInvoice − FirstInvoice in daysReady to take your skills to the next level? Enroll in our comprehensive Data Analyst Career Track to master SQL, Python, Excel, and Power BI.
Run your code to see the result here.