You can use two method for this processing. You can either do disable constraint or use on delete cascade or on delete set null in table.
Method 1
Table Name : employees
Constraints : primary_key_employee_id , foreign_key_department_idIf you want to delete row from employees, you must disable foreign key constraint.
ALTER TABLE employees DISABLE CONSTRAINT foreign_key_department_id;
After, you can delete row from employees.If you want to make enable constraint, you can use bottom query.
ALTER TABLE employees ENABLE CONSTRAINT foreign_key_department_id;
Method 2
You must do table alter. You can use on delete cascade or on delete set null.
On Delete Cascade : Deletes the dependent rows in the child table when a row in the parent table is deleted.
On Delete Set Null : Converts the dependent foreign key values to null.
ALTER TABLE employees ON DELETE CASCADE;
ALTER TABLE employees ON DELETE SET NULL;After, you can delete row from employees.
Great goods from you, man. I’ve understand your stuff previous to and you are just too magnificent.
I really like what you’ve acquired here, really like what you’re saying and the way in which
you say it. You make it enjoyable and you still take care of to keep it wise.
I can not wait to read far more from you. This is
actually a terrific website.
Hey there! I could have sworn I’ve been to
this blog before but after checking through some of
the post I realized it’s new to me. Anyhow, I’m definitely happy
I found it and I’ll be book-marking and checking back often!
Hi, its fastidious paragraph on the topic of media
print, we all understand mmedia is a wonderful source of facts.
Hi, its pleasant piece of writing regarding media print, we all know media is a fantastic source
of information.
An intriguing discussion is definitely worth comment.
I believe that you should publish more about this topic, it may not be
a taboo subject but usually people don’t discuss these issues.
To the next! Kind regards!!
I’ll immediately clutch you rss aas I cann not find your email subscription lknk or e-newsletter service.
Do you have any? Please permit mee recognise so that I may just subscribe.
Thanks.
Amazing issues here. I’m very glad to peer your
post. Thank youu a llot and I’m looking ahead to touch you.
Will you kindly drop me a e-mail?
Hi there, I wish for to subscribe for this web site to get latest updates, so
where can i doo it please help.
Thanks for every other informative blog. Where else may I get that type off information written in such an ideal approach?
I’ve a project that I aam simply now working on, and I have been at the glance out for such information.
What’s up i am kavin, its my first time to commenting anywhere, when i read this piece of writing i thought i could also
make comment due to this good post.
This article is genuinely a good one it assists new internet visitors, who
are wishing in favor of blogging.