title: Many-to-Many query using SQL
body: <p>EmployeeGroups have many MedicalPlans. MedicalPlans have many EmployeeGroups (many-to-many relationship). They are connected though the EmployeeBenefits join table</p>
  
  <pre><code>EmployeeGroup
  :id
  :name
  
  MedicalPlan
  :id
  :name
  
  EmployeeBenefits
  :id
  :employee_group_id
  :medical_plan_id
  </code></pre>
  
  <p>Does anyone know a query I can use to retrieve all the EmployeeGroups who have a certain MedicalPlan?</p>
  
  <p>I don't believe INNER JOIN works here because they do not have a atribute in common. Any help would be appreciated!</p>