Self-Joins SQL interview questions

Self-joins model hierarchies (who referred whom), pairs (products bought together) and transitions (plan upgrades). Alias carefully and avoid duplicate pairs.