title: Get records where values came from another table field SQL query
body: <p>I have two tables <code>notes &amp; folders</code>.</p>
  <p><code>notes</code></p>
  <pre><code>id | title    | folder_id
  1   sample1      1
  2    test        2
  3    parent      0
  </code></pre>
  <p><code>folders</code></p>
  <pre><code>id  |   name   | is_locked
  1     another      1
  2      test        0
  3      test2       null
  </code></pre>
  <p>Now, I want to retrieve the notes where folders.is_locked is not equal to 1 ( 1 means locked folders) or folder_id = 0.</p>
  <p>My current table records is 5 where 1 record belongs to a locked folder while the remaining 4 records belongs to unlocked folders. But my sql query below returns empty records:</p>
  <pre><code> SELECT * FROM notes AS note
   INNER JOIN folders AS folder
     ON folder.id=note.folder_id
   WHERE folder.is_locked != 1
  </code></pre>
  <p>How can I fix this?</p>