title: Oracle - How to use trigger "after insert" between 2 tables?
body: <p>I create database. I have tables, which are connected.</p>
  <blockquote>
  <p><strong>book</strong>: id_book, title, author, ..., subsidiary(foreign key to table subsidiary)</p>
  <p><strong>borrowing</strong>: id_borr, visitor, ... book(foreign key to table book)</p>
  <p><strong>subsidiary</strong>: id_subs, city, capacity, ...</p>
  </blockquote>
  <p>For now i have:</p>
  <pre><code>create table subsidiary
  (
     id_subs              smallint                       primary key,
     city                 varchar(50),
     capacity             integer
  );
  
  create table book
  (
     id_book              integer                       primary key,
     title                varchar(1000),
     author               varchar(100),
     subsidiary           smallint                      null,
     FOREIGN KEY (subsidiary) REFERENCES subsidiary(id_subs)
  );
  
  create table borrowing
  (
     id_borr              integer                       primary key,
     book                 integer                       null,
     visitor              varchar(100),
     FOREIGN KEY (book) REFERENCES book(id_book)
  );
  </code></pre>
  <p>I would like to behaviour like: <em><strong>Book has got a subsidiary. But after insert of borrowing(of some book), book change subsidiary to NULL.</strong></em></p>
  <p>I found only this example(and similar): <a href="http://www.techonthenet.com/oracle/triggers/after_insert.php" rel="nofollow noreferrer">http://www.techonthenet.com/oracle/triggers/after_insert.php</a> , but i am not still sure about that.</p>
  <p>Very thank you.</p>