create or replace trigger ReturnTicket before delete on book for each row
begin
insert into refundment(pid,tid,pname,amount)(select ticket.pid,
ticket.tid,passenger.pname,bill.amount*0.85 from ticket,passenger,bill
where ticket.tid =:old.ticket.tid);
update refundment set (paddress,pphone)=(select paddress,pphone from
passenger where pid =:old.pid)
where ticket.tid =:old.ticket.tid;
end ReturnTicket;
begin
insert into refundment(pid,tid,pname,amount)(select ticket.pid,
ticket.tid,passenger.pname,bill.amount*0.85 from ticket,passenger,bill
where ticket.tid =:old.ticket.tid);
update refundment set (paddress,pphone)=(select paddress,pphone from
passenger where pid =:old.pid)
where ticket.tid =:old.ticket.tid;
end ReturnTicket;