Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
PARTITION BY
9. OVER(PARTITION BY) – practice 1
Summary

Instruction

Fantastic. Let's do a couple of exercises to practice.

Exercise

For each journey, show its id, the production_year of the train on that journey, the number of journeys the train took as journeys_by_train and the number of journeys on the same route as journeys_by_route.

Stuck? Here's a hint!

Use COUNT(journey.id) twice, but with different OVER(PARTITION BY) clause. Join two tables.