Querying Logical Operator with Airlines using Python
Querying Logical Operator with Airlines using Python  Data Science Project
Advanced SQL

Querying Logical Operator with Airlines using Python

In this project you will work with the airlines database to explore and analyze data on various flights, airports using logical operators in SQL.In this project, you'll practice querying a MySQL Database from a Python Jupyter Notebook, using the regular MySQL connector. The project is designed to improve your ability to write precise queries, extract meaningful insights, and handle different types of constraints commonly encountered in database management systems.
Start this project
Querying Logical Operator with Airlines using Python Querying Logical Operator with Airlines using Python
Project Created by

Vidhi Shah

Project Activities

All our Data Science projects include bite-sized activities to test your knowledge and practice in an environment with constant feedback.

All our activities include solutions with explanations on how they work and why we chose them.

codevalidated

Moscow and St. Petersburg Outbound Flights

Write a query to retrieve all columns from the Flights table where the departure airport is either DME or SVO , and the arrival airport is not LED. Store the results in variable named flight_airport.

Your results will look something like:

codevalidated

Flights Between LED and DME

Write a query to retrieve all flight details from the Flights table where the scheduled departure date is between August 20, 2017, and September 1, 2017 (refer to the table to know the format of writing the date value).

Additionally, filter the results to show only flights where the arrival airport is LED or the departure airport is DME, and the aircraft code is not CN1.

The query should order the results by the scheduled departure time in descending order.

Store the results in a variable named led_dme_flights.

Your results will look something like:

codevalidated

Aircraft Range and Model

Write a query to fetch all aircrafts from the Aircrafts table where the range is between 3000-5000 (both inclusive) or 7000-9000 (both inclusive), and the length of the aircraft model name is even.

Store the results in variable named aircraft_range_and_model.

Your results will look something like:

codevalidated

Late Flights with Known Times

Write a query to retrieve flights from the Flights table where the actual departure time is later than the scheduled departure time, and both the actual departure and arrival times are not null.

Store the results in variable named late_flights_with_known_times.

Your results will look something like:

codevalidated

Odd Flight IDs and Airport Codes

Write a query to retrieve flights from the Flights table with an odd flight ID between 1000 and 10000, where either the departure or arrival airport code starts with a letter between A and C (C exclusive).

Store the results in variable named odd_flight_ids_and_airport_codes.

Your results will look something like:

codevalidated

Aircraft Range Criteria

Write a query to retrieve aircrafts from the Aircrafts table where the range is divisible by 1000 or ends in 99.

Store the results in variable named aircraft_range_criteria.

Your results will look something like:

codevalidated

Flights Within Business Hours

Write a query to fetch all flights from the Flights table scheduled to depart between 6 AM (06:00:00) and 10 PM (22:00:00), where the status is neither Cancelled nor Delayed.

Store the results in variable named flights_within_business_hours.

Your results will look something like:

codevalidated

Economy Class Seats

Write a query to retrieve all seats from the Seats table in Economy class where the seat number falls between 1A-10Z (both inclusive) or 26A-30Z (both inclusive).

Store the results in variable named economy_class_seats.

Your results will look something like:

codevalidated

Airports with Specific Timezones

Write a query to retrieve all airports from the Airports table where the timezone is in Asia/Yakutsk, Asia/Vladivostok or Europe/Moscow. Make sure the coordinates are greater than (100, 50).

Store the results in variable named airports_with_specific_timezones.

Your results will look something like:

Querying Logical Operator with Airlines using Python Querying Logical Operator with Airlines using Python
Project Created by

Vidhi Shah

As a Project Author at DataWars, I dive into the world of data science and AI/ML with a millennial flair, constantly intrigued by the inner workings of technology. While I'm not crunching numbers, you'll find me cheering for my favorite cricket team.

As a Project Author at DataWars, I dive into the world of data science and AI/ML with a millennial flair, constantly intrigued by the inner workings of technology. While I'm not crunching numbers, you'll find me cheering for my favorite cricket team.

This project is part of

Advanced SQL

Explore other projects