title: "people you may know" sql query
body: <p>I'm working on a "people you may know" feature. I have two tables:</p>
  
  <p>USERS<br>
  id<br>
  email<br>
  name<br>
  etc</p>
  
  <p>FRIENDSHIPS<br>
  user_id<br>
  friend_id</p>
  
  <p>For each friendship I make two records. Say users 7 and 9 become friends... I would make a record where user_id=7,friend_id=9 and another where user_id=9, friend_id=7 in the friendships table.</p>
  
  <p>How would I make a sql query that suggests people I'm likely to know based on friends of my friends? I also want it ordered based on the most mutual friends.</p>