create table Customer(c_no number primary key, c_name varchar2(20), c_city varchar2(20),phno number);
create table Ticket(t_no number primary key, b_date date, fare number, t_date date,c_no number references Customer(c_no));
insert into Customer values(1,'yogesh','pune',9096188754);
insert into Customer values(2,'Dipali','pune',9096188756);
insert into Customer values(3,'amol','mumbai',9096188554);
insert into Ticket values(1,'02-july-2016',600,'06-july-2016',1);
insert into Ticket values(2,'02-july-2016',600,'09-july-2016',2);
insert into Ticket values(3,'02-july-2016',600,'05-july-2016',3);
insert into Ticket values(4,'06-aug-2016',600,'06-sep-2016',1);
create or replace procedure p1(dt in date)
as
cursor c1 is select c.c_name from Customer c, Ticket t
where c.c_no=t.c_no and b_date=dt;
begin
for x in c1 loop
dbms_output.put_line(x.c_name);
end loop;
end;
declare
begin
p1('02-july-2016');
end;
Q2)
create or replace trigger t11
before insert or update on Ticket
for each row
begin
if(:new.b_date>:new.t_date) then
raise_application_error(-2013,'the booking date should be less then traveling date');
end if;
end;
Recent Posts
Posted on 2019-07-18
Posted on 2019-07-18
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-05-28
Posted on 2019-05-24
Posted on 2019-05-24
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23