Exercise

CASE statements comparing two column values part 2

Similar to the previous exercise, you will construct a query to determine the outcome of Barcelona's matches where they played as the away team. You will learn how to combine these two queries in chapters 2 and 3.

Did their performance differ from the matches where they were the home team?

Instructions

100 XP
  • Complete the CASE statement to identify Barcelona's away team games (id = 8634) as wins, losses, or ties.
  • Left join the teams_spain table team_api_id column on the matches_spain table hometeam_id column. This retrieves the identity of the home team opponent.
  • Filter the query to only include matches where Barcelona was the away team.