title: How to check if a user has data in certain tables
body: <p>So the approach I'm taking is to create new boolean columns on the user table that if is set to true, then the table has data, if false the table is empty. Now I'm stuck because I don't know how to create the triggers, or more like the procedure that follows the trigger.</p>
  
  <p>So my logic is...for each table have a trigger:</p>
  
  <pre><code>CREATE TRIGGER check_sales_trigger
    AFTER INSERT OR DELETE
    ON sales
    FOR EACH ROW
    EXECUTE PROCEDURE check_sales_table();
  </code></pre>
  
  <p>Then, create a procedure that updates the boolean column on the user table for each table. So basically I need help creating the procedure.</p>
  
  <p>FYI, each client has his own db.</p>