Summary
In this chapter, we learned about the power of window functions. We looked at how to construct a basic window function using OVER
, PARTITION BY
, and ORDER BY
. We then looked at how to calculate statistics using window functions, and how to adjust a window frame to calculate rolling statistics.
In the next chapter, we will look at how to import and export data in order to utilize SQL with other programs. We will use the COPY
command to upload data to your database in bulk. We will also use Excel to process data from your database and then simplify your code using SQLAlchemy.