For each company, find time the company's planes have spent during accomplished flights. Result set: company name, time in minutes.
The issue with this exercise may be illustrated by a message of one of our participants:
Misunderstanding is caused by insufficient studying of the description and the scheme of database. Trip table represents the schedule of flights, which are carried out daily.
The information on flights of passengers contains in Pass_in_trip table. Let's look what flights of the company with id_comp=2 have been carried out:
Here is the result of the query above:
So, the first flight has been carried out twice, but the second one did not be carried out at all, i.e. 108*2 = 216.