Answer the question
In order to leave comments, you need to log in
How to remove related entities in one request?
Hello, I tried to delete a row from the patr table and a row with a reference key referring to it
here are the table structures
Create table part(
p_no integer primary key,
p_name varchar(20) not null,
price integer not null,
color varchar(1) not null,
weight integer not null
);
create table cells(
sno integer not null,
pno integer not null,
foreign key(sno) references supplier(sno),
foreign key(pno) references part(p_no)
);
delete cells as c, part as p from с, p where c.pno = (
select p.p_no from p where p.p_name = 'Bearing') and p.p_name = 'Bearing';
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question