Introduction
LEAD() and LAG()
14. Practice 2
FIRST_VALUE(), LAST_VALUE()
Summary

Instruction

Perfect. One more!

Exercise

Let's define conversion rate as the number of clicks divided by the number of impressions, multiplied by 100 to obtain a percentage.

For WebsiteId = 1 and the dates between May 15 and May 31, show the following for each row: Day, Clicks, Impressions, the conversion rate and the conversion rate on the previous day. Name the last two columns ConversionRate and PreviousConversion.

Stuck? Here's a hint!

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