SQL tutorial 19: ON DELETE SET NULL clause of Foreign Key By Manish Sharma (RebellionRider)




SQL Tutorial 19 : ON DELETE SET NULL foreign key Clause. Links used in the tutorial On delete set null website article [ download SQL script from same link] …

Original source


17 responses to “SQL tutorial 19: ON DELETE SET NULL clause of Foreign Key By Manish Sharma (RebellionRider)”

  1. tnx Manish. you are doing great. I need to add a comment I think drop foreign key and re-create it missed.
    ALTER TABLE books DROP CONSTRAINT bok_col3_fk; — drop foreign key
    ALTER TABLE books ADD CONSTRAINT bok_col3_fk FOREIGN KEY (book_author_id) REFERENCES authors(author_id) ON DELETE SET NULL;

  2. Very good videos. Getting a thorough understanding of concepts. You should think of creating tutorial videos for websites like Udemy. Its just a suggestion as you will get wider student audience. Best Of luck!!

  3. Hi Manish, Thanks for your tutorials.
    I have a question, why am i not able to see any data under user_constraints table, any idea. I created Child table under HR schema and when i run user_constraints no data is returned.

  4. Thanks for this tutorial Manish. I was wondering if you can set another value like Nil instead of Null when deleting a foreign key? The reason I ask is because in database at work, when I remove a relationship between some object tables, the business rule states that I need to remove the applicability of that object, where an applicability of that object can be more than 1 variable across multiple rows. In that situation where the primary key in a parent table existing in the children table more than once as shown by the multiple rows, is there a way to set the delete to Nil to change the objects applicability?

Leave a Reply