From the course: Intermediate SQL for Data Scientists

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Challenge: Rewrite a complex query to use CTEs

Challenge: Rewrite a complex query to use CTEs

From the course: Intermediate SQL for Data Scientists

Challenge: Rewrite a complex query to use CTEs

(upbeat music) - [Instructor] Here's a query that computes a couple of aggregate functions over the employees table, but it's restricted to employees that are in regions that have the word east in the name. We write this query using a Common Table Expression. In this challenge, you will be given a query that uses a subquery in the WHERE clause, and the challenge is to write an equivalent query that uses a Common Table Expression instead of a subquery.

Contents