title: Converting Pseudocode to SQL Script
body: <p>So I have two tables:</p>
  
  <ol>
  <li><code>Bookmarks</code> has a few columns [id, etc.]</li>
  <li><code>Person_Bookmark</code> has 2 columns [personId, bookmarkId]</li>
  </ol>
  
  <p><code>Bookmarks</code> represents links to other websites. All valid bookmarks have an id. The <code>Person_Bookmark</code> table has a bunch of <code>personIds</code> and their bookmarks, shown as <code>bookmarkId</code>.</p>
  
  <p>Here's my pseudocode:</p>
  
  <pre><code>&gt; let x = integer list of all bookmarkId's from Person_Bookmark
  &gt; 
  &gt; for each x  {   
  &gt;     if ('select * from 'Bookmarks' where 'id' = x returns 0 rows) {
  &gt;       delete from 'person_bookmark' where 'bookmarkId' = x
  &gt;     }
  &gt; }
  </code></pre>
  
  <p>Please advise me how to convert to a Postgres [edit] SQL script.</p>