title: foreign key constraint on update cascade on delete cascade
body: <p>I have two tables: one and two. I have a primary key (id) in table one.</p>
  
  <p>Table One:</p>
  
  <pre><code>CREATE TABLE `one` (
  `id` int(20) NOT NULL AUTO_INCREMENT,
  `first_name` varchar(10) NOT NULL,
  `last_name` varchar(10) NOT NULL,
  `salary` int(100) NOT NULL,
  `login_date_time` datetime NOT NULL,
  PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1
  
  id    first_name    last_name    salary  login_date_time 
  </code></pre>
  
  <p>Table Two</p>
  
  <pre><code>CREATE TABLE two AS (SELECT id,salary ,CONCAT(first_name, ',', last_name) AS Name from one)
  </code></pre>
  
  <p>Now adding the foreign key to id as:</p>
  
  <pre><code>ALTER TABLE two
  ADD CONSTRAINT `0_38775` FOREIGN KEY (id)
  REFERENCES one(id) ON DELETE CASCADE ON UPDATE CASCADE
  </code></pre>
  
  <p>the table <code>two</code> comes as with the values from table <code>one</code>:</p>
  
  <pre><code>id    salary       name  
  </code></pre>
  
  <p>Now to maintain referential integrity, how to update the values of <code>table two</code> when <code>table one</code> is updated. And also I cannot delete rows from <code>table one</code> and cannot insert rows to <code>table two</code>. </p>
  
  <p>How can I update all the columns of <code>table two</code> when <code>table one</code> is updated/inserted. or insert explicitly into <code>table two</code></p>