1. Learn
  2. /
  3. Courses
  4. /
  5. Data Manipulation in SQL

Exercise

Get team names with a subquery

Let's solve a problem we've encountered a few times in this course so far -- How do you get both the home and away team names into one final query result?

Out of the 4 techniques we just discussed, this can be performed using subqueries, correlated subqueries, and CTEs. Let's practice creating similar result sets using each of these 3 methods over the next 3 exercises, starting with subqueries in FROM.

Instructions 1/2

undefined XP
    1
    2
  • Create a query that left joins team to match in order to get the identity of the home team. This becomes the subquery in the next step.