From the course: Complete Guide to SQL for Data Engineering: from Beginner to Advanced

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Solution: Find out the sum

Solution: Find out the sum

(upbeat music) - [Instructor] To find out the sales volume, this could be the answer. So here, let's see what I have did. I'm saying that select product_id, order_timestamp and total_quantity, and I'm saying sum of this total_quantity, partition by product_id. And we have sorted it based on the order_timestamp. And I just given alias as running_qty. So this will exactly solve our problem. If I execute this, you will get the running_qty and based on the order timestamp.

Contents