title: Mysql join match multiple rows from each table
body: <p>Here is a simplified version of the pertinent part of my DB:</p>
  
  <pre><code>Person:
      id
  
  PersonSkills:
      person_id
      skillname
      ability
  
  Position:
      id
  
  PositionSkills:
      position_id
      skillname
      ability
  </code></pre>
  
  <p>A person can have any number of PersonSkills, let's say in this instance, our user has 6.
  A Position can require any number of PositionSkills, let's say in this instance the position requires 3.
  I need a query that will determine whether ALL of the PositionSkills associated with this Position are present in the PersonSkills associated with this person. (I also need to ensure that the PersonSkill's ability is greater than the PositionSkill's ability, but I think that will be simple once I figure out the part that is giving me trouble here.)</p>
  
  <p>Thanks in advance,
  Jason</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Here is more detail on what I'm looking for:</p>
  
  <pre><code>PersonSkills
  +-------------+---------+---------+
  | person_id   | skill   | ability |
  +-------------+---------+---------+
  |     1       |  A      | 5       |
  |     1       |  B      | 4       |
  |     1       |  C      | 5       |
  |     1       |  D      | 4       |
  |     1       |  E      | 5       |
  +-------------+---------+---------+
  
  PositionSkills
  +-------------+---------+---------+
  | position_id | skill   | ability |
  +-------------+---------+---------+
  |     5       |  A      | 3       |
  |     5       |  B      | 3       |
  |     5       |  C      | 3       |
  |     6       |  A      | 3       |
  |     6       |  B      | 3       |
  |     6       |  Z      | 3       |
  +-------------+---------+---------+
  </code></pre>
  
  <p>From the fact that I'm user 1, I want a query to tell me that I am qualified for Position 5, because I have skills A, B, and C, that it requires, but that I am not qualified for Position 6, because I lack skill Z</p>
  
  <p>Thanks again,
  Jason</p>