Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
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, 2016, show the following for each row: Day, Clicks, Impressions, the conversion rate (as the ConversionRate column) and the conversion rate on the previous day (as the PreviousConversion column).

Stuck? Here's a hint!

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