title: SQL - TRIGGER AFTER INSERT
body: <p>I have two tables - '<strong>clients</strong>' and '<strong>clients_address</strong>'</p>
  
  <p>There is on table '<strong>clients</strong>' column with name '<strong>phone</strong>'.
  I need to have the same column '<strong>phone</strong>' in table '<strong>clients_address</strong>'</p>
  
  <p>I create column '<strong>phone</strong>' in table '<strong>clients_address</strong>' and whit this command I copied the data from '<strong>clients.phone</strong>':</p>
  
  <pre><code>UPDATE clients_addresses
  SET clients_addresses.phone=(SELECT clients.phone
  FROM clients
  WHERE clients.id=clients_addresses.client_id);
  </code></pre>
  
  <hr>
  
  <p>Everything is copied correctly, but it is not autoupdate. And after new user registration i need to execute this command again. I try with trigger, but SQL return me sintax error. This is what I try:</p>
  
  <pre><code>CREATE TRIGGER up
  ON clients.phone
  AFTER INSERT 
  BEGIN
  UPDATE clients_addresses
  SET clients_addresses.phone=(SELECT clients.phone
  FROM clients
  WHERE clients.id=clients_addresses.client_id)
  END;
  </code></pre>
  
  <hr>
  
  <p>I am not very good in sql. Please help.</p>