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 - SQL Tutorial
From the course: Complete Guide to SQL for Data Engineering: from Beginner to Advanced
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.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
(Locked)
Introduction to analytical functions5m 31s
-
(Locked)
Using the RANK() function7m 16s
-
(Locked)
Using the DENSE_RANK() function4m 27s
-
(Locked)
Exploring the ROW_NUMBER() function6m 35s
-
(Locked)
Understanding the LAG() and LEAD() functions7m 55s
-
(Locked)
Running totals with SUM() OVER()7m 29s
-
(Locked)
Calculating moving averages7m 33s
-
(Locked)
Challenge: Find out the sum33s
-
(Locked)
Solution: Find out the sum44s
-
(Locked)
-
-
-
-
-
-
-