On June 18th at 10:00 AM UTC Academy will be unavailable for 5 minutes due to planned maintenance break.
Rainbow Deals - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
PARTITION BY
11. OVER(PARTITION BY) – practice 3
Summary

Instruction

Fantastic! Let's do a couple of exercises to practise.

Exercise

For each ticket, show its id, price and, the column named ratio. The ratio is the ticket price to the sum of all tickets purchased on the same journey.

Stuck? Here's a hint!

In order to avoid integer division, you can write CAST(price AS numeric).