title: JOIN functionality between multiple tables
body: <p>Tables:</p>
  
  <p>Client</p>
  
  <pre><code>CID    Name
   1      A
   2      B
   3      C
   4      D
   5      E
   6..(And so on)
  </code></pre>
  
  <p>Visit</p>
  
  <pre><code>VID CID type
  1   1   Med
  2   3   Non
  3   2   Non
  4   6   Med
  5   4   Med
  6..(And so on)
  </code></pre>
  
  <p>Payment</p>
  
  <pre><code>PID   CID  amount
  1      1       10
  2      1       20
  3      2       30
  4      2       40
  5      3       50
  6..(And so on)
  </code></pre>
  
  <p><strong>Desired Output:</strong></p>
  
  <pre><code>CID  Name  type   amount
  1     A     Med    10
  1     A     Med    20
  4     D     Med    NULL
  (And so on..)
  </code></pre>
  
  <p>Query:</p>
  
  <pre><code>SELECT DISTINCT
  C.client_id
  ,C.name
  ,V.type
  ,P.payment
  
  FROM Clients C
  INNER JOIN Visit V
      ON C.cid=V.cid
  LEFT JOIN Payment P
      ON V.cid=P.cid
  </code></pre>
  
  <p>I used a LEFT JOIN because I wanna see who made payments and who didn't.</p>
  
  <p><strong>Question:</strong> Do LEFT JOINS (or outer joins) pull in data based on the common id's in the CID of the left table resulting from preceding INNER JOINS(The common result set)? Or do they consider ALL the id's in the left table and ignore the INNER JOINS results altogether? 
  I only want payment details of the clients existing in the inner joins and not outside it.</p>