Course Content
Intermediate SQL
2. Nested Subqueries
4. Left, Right, and Inner Joins
Intermediate SQL
Challenge: Find the Number of Passenger
Task
- You need to find the number of passengers on each departure date;
- For it you have to join two tables:
departure
andpassenger
; - Use the
name_passenger
column from thepassenger
table and thedeparture_date
column fromdeparture
; - Join these two tables by the
number_of_departure
column; - Make grouping using the
GROUP BY
clause by thedeparture_date
column from thedeparture
table.
Here's a short example of the passenger
table:
id | number_of_departure | name_passenger | surname_passenger |
1 | 5 | Liam | Smith |
2 | 5 | Olivia | Johnson |
... | ... | ... | ... |
18 | 5 | Olivia | Johnson |
Here's a short example of the departure
table:
number_of_departure | flight_number | departure_date | departure_time |
1 | 3 | 2022-07-16 | 08:00:00 |
2 | 1 | 2022-07-18 | 13:15:00 |
... | ... | ... | ... |
6 | 3 | 2022-07-16 | 08:00:00 |
Everything was clear?
Section 3. Chapter 4