Session Ready
Exercise

Get team names with CTEs

You've now explored two methods for answering the question, How do you get both the home and away team names into one final query result?

Let's explore the final method - common table expressions. Common table expressions are similar to the subquery method for generating results, mainly differing in syntax and the order in which information is processed.

Instructions 1/3
undefined XP
  • 1
  • 2
  • 3
  • Select id from match and team_long_name from team. Join these two tables together on hometeam_id in match and team_api_id in team.