title: List number of duplicate values
body: <p>I have the following a Rails ActiveRecord association where a lesson has_many books, and books belong_to a lesson. I want to run a SQL command that will tell me how many lessons have multiple books that belong to that lesson.</p>
  
  <p>Ex: Lesson 1 has books 1 and 2, and I want to see how many times that happens.</p>