Top Travellers
SQL teaching model: attach each user to their rides with a left join, sum the distance per user so that users without rides show zero, then sort by total distance descending and name ascending.
SQL teaching model: attach each user to their rides with a left join, sum the distance per user so that users without rides show zero, then sort by total distance descending and name ascending.