More Complex FilteringMore Complex Filtering

But we can also make more complicated filtering, for example, by two columns. Let's see the syntax of such filtering.

It will be easier to understand it in practice!

Task

You have to find the subway lines (line_name column) with a total ride time (using the time_to_next_station column and SUM() function create new one, named total_time) of more than 50 minutes and total number of stations (using the station_name column and COUNT() function create new one, named number_of_stations) on this line is greater than 5.

Here's a short example of the relation table:

relation_idline_namestation_nametime_to_next_station
1GreenAngrignon10
2GreenMonk16
3GreenVerdun9
............
21YellowLongueuil10

Everything was clear?

Section 1. Chapter 8
toggle bottom row