Writing triggers of a table to automatically update another table
<p>I got these tables (Oracle):</p>

<pre><code>Doctors (Doctor_ID (PK),
         Doctor_Name,
         DoB,
         Specialization)

Doctors_At_Work (Doctor_ID (PK),
                 The_Date (PK),
                 Hour_Start (PK),
                 Hour_Stop,
                 Room)

Consultations_Intervals (Doctor_ID (PK),
                        The_Date (PK),
                        Start_Hour_Consult (PK),
                        Stop_Hour_Consut,
                        Room)

OBS: A consultation last for only 30 minutes.
</code></pre>

<p>My task is to create the necessary triggers (insert/update/delete) of <code>Doctors_At_Work</code> in order to automatically update the <code>Consultations_Intervals</code> table.</p>

<p>What I did so far:</p>

<pre><code>Create sequence seq_id_doctor START with 1 INCREMENT BY 1 ORDER NOCACHE;

CREATE OR REPLACE trigger t_1
        BEFORE INSERT ON Doctors_At_Work FOR EACH ROW
BEGIN
   :NEW.Doctor_ID:=seq_id_doctor.NextValue;
   :NEW.The_Date:=CURRENT_TIMESTAMP;
   :NEW.Hour_Start:=Select Extract (Hour from CURRENT_TIMESTAMP);
END;
/

CREATE OR REPLACE trigger t_2
        AFTER INSERT OR UPDATE ON Consultations_Intervals FOR EACH ROW
BEGIN
INSERT INTO Consultations_Intervals VALUES 
(:NEW.Doctor_ID, :NEW.The_Date, :NEW.Hour_Start, :NEW.Hour_Start + 
  interval '30' minute, :NEW.Room);
END;
/
</code></pre>

<p>What is wrong with it? How should I solve this task? (if there are other ideas)</p>