Question: Window Functions
Explore how to use window functions in SQL to analyze customer orders over time. Learn to calculate running totals and rank orders within each customer's history by joining Customers and Orders tables to produce detailed analytics outputs.
We'll cover the following...
Question
Given the following structure of the Customers table:
Field | Type |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Where, CustomerID is the primary key and ReferralID is self-referencing to CustomerID. The table contains information about customers. In the table, each customer is categorized by a CustomerTier to reflect their engagement level. The possible values are 'New', 'Regular', and 'VIP' ...