In this SQL lesson, you’ll learn how to write complex, nested queries using subqueries. Being able to write complex SQL queries is a skill that every data analyst and data scientist needs to know.
Often, the data you will want is not easily obtainable using a single query. As you progress through your data analyst or data scientist career, you’ll notice that you need to be able to write a subquery, or a query inside another query, to get the data you want to look at in the format you want it.
In this lesson, you will learn what subqueries are and how they can be beneficial as you write more and more queries. As you start this lesson, you will see the basic form of a subquery and learn to write your own to complete each exercise. You’ll also learn about using the IN operator to check for membership within a group, and about how the `IN` operator can be used to subquery data.
As with previous lessons in this course, you’ll be working with the 2010-2012 college grad data to answer real-world data science questions as you practice your SQL skills and get more comfortable with writing complex queries as part of a data science workflow.
- Learn how to use subqueries to nest queiries in the SELECT clause.
- Learn how to use subqueries to nest queries in the WHERE clause.
- Writing More Complex Queries
- Subquery In SELECT
- Returning Multiple Results In Subqueries
- Building Complex Subqueries
- Practice Integrating A Subquery With The Outer Query
- Next Steps