I've got a database consisting of four tables. Relation schema as follows in the picture:
And here are the rows:
Now I'm trying to delete the owner with owner id OW1
. Because the id is a primary key in owner table and foreign key in other table its not allowing me to delete the row. Here is the SQL I tried:
delete from owners
where ownerid = 'OW1' and petid = 'PT1'
And it returns :
ORA-02292: integrity constraint (TEST_1.ADDRESSES_OWNERS_FK) violated - child record found
And I'm not allowed to set the delete rule to 'CASCADE' in relation diagram. Please help :(