Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8898955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:44:30+00:00 2026-06-15T00:44:30+00:00

I have a parent table say A and a child say B and B

  • 0

I have a parent table say A and a child say B and B references A’s primary key
so most people will use on delete cascade to modify the tables when they delete from the parent A.
My question is: is there any example of a situation that I WILL NOT need ‘on delete cascade’?
When will it be not useful to use?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:44:31+00:00Added an answer on June 15, 2026 at 12:44 am

    I don’t like Marc B’s example, because products generally would not be “children” of a category. Products and Categories can overlap, with a many-to-many relationship.

    I have ON DELETE SET NULL in situations where the data is still useful without the parent.

    E.g.

    Suppose you have a translations table that contains columns id,translation_category,from_text, to_text

    That table contains various text to text translations. The translation_category is a foreign key that references a specific field where the translations would be primarily used. But you could also do queries that ignore that key to get a count of common from_text and to_text values, since they may be repeated for different translation_category values.

    That data is still perhaps useful even if you happen to delete one of the translation_category parent records. So I would use ON DELETE SET NULL there.

    Of course, that same schema could be changed to put translation_category into a many-to-many linking table, but the same principles still apply.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a table parent with primary key id , and a
I have 2 tables (say parent and child table and 1 to many relation),
Say I have a table with 50 rows. I have parent/child relationships in that
If I have a parent table and a child table where there can be
I have a simple parent/child tables. Contract is the parent table. Each contract can
I have two tables Loan(Parent Table) and Receipt(Child table)what i want to do is
Suppose I have this table parent | child 1 2 1 3 2 4
I have a database table with parent child relationships between different rows. 1 parent
Let say I have 1 parent data and 3 child data like a chain:
Updated I have some huge data, which becomes a large table say table parent

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.