title: Why there is an output difference between o.id(primary_key) and o.account_id(Foreign_key)?
body: <p>When I put those two different lines of code, they give me different outputs. Why is that? The purpose of the code is to find those companies that spent more per order than the average of all orders.</p>
  <p>1.
  <a href="https://i.stack.imgur.com/SpQMm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SpQMm.png" alt="enter image description here" /></a></p>
  <p>2.
  <a href="https://i.stack.imgur.com/NOYIb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NOYIb.png" alt="enter image description here" /></a></p>
  <p>The schema is this:</p>
  <p><a href="https://i.stack.imgur.com/FJrgN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FJrgN.png" alt="enter image description here" /></a></p>