title: sql get students names who passed in all subjects
body: <p>I have 3 tables</p>
  
  <p>students(id,name)</p>
  
  <p>subjects(id,name)</p>
  
  <p>student_subjects(student_id,subject_id,mark)</p>
  
  <p>I want to select student names who passed all subjects (who have mark>=50 in all subjects)</p>
  
  <p>I tried this:</p>
  
  <pre><code>SELECT DISTINCT s.NAME
  FROM STUDENT_SUBJECTS sb,
    STUDENTS s,
    SUBJECTS b
  WHERE s.ID   = sb.STUDENT_ID
  AND b.ID     = sb.SUBJECT_ID
  AND sb.MARK &gt;= 50
  </code></pre>
  
  <p>but this get students who have any subject that is bigger than or equal to 50
  is there any way to get just the names of students who passed all subjects?
  <img src="https://i.stack.imgur.com/KCELt.png" alt="oracle schema"></p>