A walkthrough of a real SQL interview problem asked for a data analyst role with four years of experience. The problem involves computing football World Cup group stage points for each team using two tables (teams and matches). The solution uses CTEs, CASE statements to assign win/draw/loss points, aggregation by host and guest team separately, a FULL JOIN to combine host and guest scores, and a RIGHT JOIN with the teams table to include teams that played no matches. The final query returns teams ordered by points descending, then by team ID ascending.
•17m watch time
1 Impression