Django object-relational mapping (ORM) comes with special abstraction constructs that can be used to build complex database queries. They are called query expressions, and they allow you to filter data, order it, annotate new columns, and aggregate relations. In this recipe, you will see how that can be used in practice. We will create an app that shows viral videos and counts how many times each video has been seen by anonymous (versus logged-in) users.