title: mysql average count from related table
body: <p>I have two tables:</p>
  <h3>users table</h3>
  <p>list of users</p>
  <h3>stories</h3>
  <p>list of stories - multiple stories per user</p>
  <p>I want to know the average number of stories a user has.  (not a specific user, for all users)</p>
  <p>Expected results: 2.3 average stories per user</p>
  <p>Tried:</p>
  <p>select avg(w) from (select count(distinct user_id) as w from stories group by user_id) a;
  above ran but didn't seem correct</p>
  <p>also:</p>
  <p>SELECT user_id, ( SELECT COUNT(*) FROM stories w WHERE w.user_id = u.user_id ) as TotalStories FROM user u;</p>
  <p>returned average stories for each user, not average for overall</p>