Introduction
LEAD() and LAG()
13. Practice 1
FIRST_VALUE(), LAST_VALUE()
Summary

Instruction

Ok, let's do two more analytical exercises for practice.

Exercise

RPM (revenue per thousand impressions) is defined as the Revenue divided by the number of impressions, times 1000.

RPM = (revenue / number of impressions) * 1000

For each statistics row where WebsiteId = 2, show the Day, the RPM and the RPM seven days later. Rename the columns to RPM and RPM7.

Stuck? Here's a hint!

To avoid integer division, use CAST(Column AS NUMERIC).