Company: Fractal

Difficulty: easy

Problem Statement

You are given two tables, `routes` and `tickets`, representing a travel agency's route and ticket details. Write a query to find the average ticket price for each route. Arrange the output in increasing order of `route_id`. The average price must be rounded up to two decimal places. Table: `routes` (`route_id` INT, `origin_city` VARCHAR, `destination_city` VARCHAR, `distance` DECIMAL) Table: `tickets` (`ticket_id` INT, `route_id` INT, `price` DECIMAL) Return columns `route_id` and `average_price`. Include only routes that have at least one ticket.

More Fractal OA questionsInterview experiences