Q1)
create or replace procedure p1(dt in date)
as
cursor c1 is select t.t_name,p.p_no,p_name,addr,age from Train t,Passenger p,T_P tp
where t.t_no=tp.t_no and p.p_no=tp.p_no and date1=dt;
begin
for x in c1 loop
dbms_output.put_line(x.t_name||' '||x.p_name||' '||x.addr||' '||x.age);
end loop;
end;
declare
begin
p1('01-july-2014');
end;
Q2)
create or replace trigger t15
before insert or update on T_P
for each row
begin
if(:new.date1<:new.date1) then
raise_application_error(-2013,'the current date should be greater then old date');
end if;
end;