title: SQL query to join four tables
body: <pre>
  User table - user Id, first name, last name
  Investment table - investment Id, investment Name
  NDA table- investment Id, user Id, NDA signed(boolean)
  Permission table - investment Id, user Id, view permission(boolean)
  </pre>
  
  <p>Result I need - First name and Last name of users who has NDA Signed or view permission true/false for a particular invesment Id.</p>
  
  <p>Input - invesment Id</p>
  
  <p>Output - first name, last name, NDA signed (true/false), view permission (true/false) </p>
  
  <p>I got query where output is first name, last name , NDA signed</p>
  
  <pre><code>SELECT u.First_Name, u.Last_Name, n.Nda_Signed 
  FROM user u 
  JOIN nda n ON u.User_Id = n.User_Id 
  JOIN investment i ON i.Investment_Id = n.Investment_Id 
  WHERE i.Investment_Id =347
  </code></pre>
  
  <p>but having problem in joining both nda and permission table.</p>