title: How to check if all of a Teachers students have met a requirement
body: <p>I have to do the below for every teacher.</p>
  
  <p>Given a TeacherId, I want to select all students who have this Teacher and have passed the first semester.
  If all the teachers students have passed, I want to call another stored procedure:</p>
  
  <pre><code>EXEC AllTeachersStudentsPassedSemester1 @teacherId
  </code></pre>
  
  <p>The tables are as follows:</p>
  
  <p>Teacher
      - teacherId</p>
  
  <pre><code>Students
   -userId
   -teacherId
  
  CourseSummarry
   -userId
   -passedSemester1 (bool)
  </code></pre>
  
  <p>So to get all users for a given teacher I have:</p>
  
  <pre><code>SELECT userId
  FROM Students
  WHERE teacherId = @teacherId
  </code></pre>
  
  <p>How can I test if all the students in that list have passedSemester1 = TRUE, and then call that proc <code>AllTeachersStudentsPassedSemester1</code> for that teacher.  Confused how I can check if all the students have passed.</p>
  
  <p>I then have to somehow loop through all teachers to do this.</p>
  
  <p>This seems like I have to program this in code rather than sql.</p>