While working with databases, we often need to transform data from one format to achieve a desired result. In SQL, this is often called data transformation or table transformation.

We’ll begin learning about table transformation through subqueries. Subqueries, sometimes referred to as inner queries or nested queries, are used to transform table data by nesting one query within another query.

In this lesson, we’ll look at aviation data and transform it with SQL using subqueries. If you’re new to SQL, we recommend you do this course first.



We’ll be working with an airport database. Let’s begin by looking at the data tables.

Select ten rows from the flights table.

Sign up to start coding

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?