Kickstart 2020 with new opportunities! - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
LEAD and LAG
14. Practice 2
FIRST_VALUE, LAST_VALUE, NTH_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 percentages.

For website_id = 1 and dates between May 15 and May 31, show each statistics row: day, clicks, impressions, conversion rate (as the conversion column) and the conversion rate on the previous day (as the previous_conversion column).

Stuck? Here's a hint!

To avoid integer division, use CAST(column AS numeric).