title: Understanding a complex SQL query
body: <p>I'm poor in SQL and when I got a SQL query below I was very confused about the <code>a</code> and <code>b</code> in it. What are their roles in the query and what's the function or result of this?</p>
  
  <pre><code>SELECT *,(SELECT COUNT(id) FROM abc_menu b WHERE b.parentId=a.id ) FROM abc_menu a ORDER BY ordering ASC
  </code></pre>