title: sql select all record for all
body: <p>so there is 3 tables </p>
  
  <p>1 passanger detail</p>
  
  <p>2 booking</p>
  
  <p>3 flight</p>
  
  <p>passanger</p>
  
  <pre><code>+----+------+
  | id | name |
  +----+------+
  |  1 | A    |
  |  2 | B    |
  |  3 | C    |
  +----+------+
  </code></pre>
  
  <p>booking</p>
  
  <pre><code>+----+-------+
  | id |flight |
  +----+-------+
  |  1 |   101 |
  |  1 |   102 |
  |  1 |   103 |
  |  2 |   101 |
  |  3 |   104 |
  |  2 |   105 |
  +----+-------+
  </code></pre>
  
  <p>flight</p>
  
  <pre><code>+--------+------+
  | flight | late |
  +--------+------+
  |    101 |   80 |
  |    102 |   80 |
  |    103 |   80 |
  |    104 |   10 |
  |    105 |   10 |
  +--------+------+
  </code></pre>
  
  <p>table 1 contains passnger id and name</p>
  
  <p>table 2 contains passanger id and its flight id</p>
  
  <p>table 3 contains flight id and how much minute it is late </p>
  
  <p>now i want to find out name of the passanger whose all flights are 50 minutes late or more </p>
  
  <p>so the output will be <code>A</code> because 101 102 and 103 are late by 80 min </p>
  
  <p><strong>not <code>B</code> because 101 is 80 mins late but 105 is 10 mins late (not all of b's flights are late by 50)</strong></p>
  
  <p>so my approach is </p>
  
  <pre><code>select name from passanger,booking where passanger.id=booking.id and booking.flight = ALL (select flight.flight from flight where flight.late&gt;50)
  </code></pre>
  
  <p>can't get the desired output.</p>