Get team names with correlated subqueries
Let's solve the same problem using correlated subqueries -- How do you get both the home and away team names into one final query result?
This can easily be performed using correlated subqueries. But how might that impact the performance of your query? Complete the following steps and let's find out!
Please note that your query will run more slowly than the previous exercise!
This exercise is part of the course
Data Manipulation in SQL
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
SELECT
m.date,
(SELECT team_long_name
FROM team AS t
-- Connect the team to the match table
WHERE ___ = ___) AS hometeam
FROM match AS m;