Enqurious logo
Go back

Calculate Longest Flight Path in a Day

6 Inputs
1 Hour
Advanced
scenario poster
Industry
airline
Skills
data-wrangling
Tools
sql

Learning Objectives

Understand the use of Common Table Expressions (CTEs) to structure queries and simplify complex calculations.
Apply recursive techniques to process sequential relationships within datasets.
Leverage string processing techniques to construct dynamic and structured output formats.
Apply knowledge of join operations to establish relationships between interconnected data points.
Utilize filtering and sorting strategies to prioritize and extract the most relevant results.

Overview

SkyConnect Airways operates multiple aircraft across various routes daily, often with each aircraft making several connected hops. The airline aims to identify the longest connected flight path for each aircraft on a given date. This helps optimize maintenance scheduling, fuel planning, and crew assignments.


Connected flights are those where the source airport of one matches the destination of the previous. Analyzing these sequences provides clarity on aircraft movement and utilization.


In this scenario, your task is to write an SQL query that identifies the longest such connected path per aircraft per day, enabling the Operations Control Center (OCC) to make more informed and efficient operational decisions.

Prerequisites

  • Knowledge of basic SQL concepts like SELECT, WHERE, GROUP BY, HAVING, ORDER BY, and JOIN.
  • Understanding of Common Table Expressions (CTEs), including recursive CTEs for handling hierarchical data.
  • Familiarity with string processing techniques for formatting and constructing dynamic outputs.
Redefining the learning experience

Supercharge Your
Data+AI Teams with us!