Xperiment Name: Create A Table Where Student Table Delete
Xperiment Name: Create A Table Where Student Table Delete
Xperiment Name: Create A Table Where Student Table Delete
E-R Diagram
constraint ck_product_6
check(unit_cost<unit_price)
);
desc product;
(
order_no varchar2(6),
product_no varchar2(6),
sold_qty number(5) default 0,
constraint pk_sales_details_12
primary key(order_no,product_no),
constraint fk_sales_details_1
foreign key(order_no) references sales(order_no),
constraint fk_sales_details_2
foreign key(product_no) references product(product_no)
);
where product.product_no=:new.product_no;
elseif deleting then
update product
set qty_on_hand=qty_on_hand+:old.sold_qty
where product.product_no=:old.product_no;
end if;
end;
/
begin
insert into product
values('p00001','Monitor(LG44i)','pc',5000,50,4500);
insert into product
values('p00002','KB(Mitsumi)','pc',200,100,150);
insert into product
values('p00003','MB(Asus)','pc',2500,30,2000);
insert into product
values('p00004','Mouse','pc',100,100,80);
insert into product
values('p00005','Speaker','pc',750,20,600);
insert into product
values('p00006','Processor','pc',2500,50,2100);
end;
/
begin
insert into salesman
values('s00001','Shafiq','Dhaka','M','S','12-Jan-75');
insert into salesman
values('s00002','Rana','Dhaka','M','S','23-Jul-77');
insert into salesman
values('s00003','Rajib','Comilla','M','S','08-Mar-78');
insert into salesman
values('s00004','Rakib','Comilla','M','S','26-Feb-74');
insert into salesman
values('s00005','Nafis','Dhaka','M','M','10-Feb-69');
insert into salesman
values('s00006','Nazim','Dhaka','M','M','05-Jan-67');
end;
/
begin
insert into customer
values('c00001','Asraf','Dhaka');
insert into customer
values('c00002','Raju','Dhaka');
begin
insert into sales
values('o00001','12-Mar-99','s00006','c00001');
insert into sales
values('o00002','14-Mar-99','s00003','c00002');
insert into sales
values('o00003','14-Mar-99','s00003','c00003');
insert into sales
values('o00004','15-Mar-99','s00002','c00004');
end;
/
begin
insert into sales_details
values('o00001','p00006',1);
update student
set Mobile='01710200333'
where ID='C113007';
values('CSE2407','Assembly Language',1);
);