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 6064735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:18:46+00:00 2026-05-23T09:18:46+00:00

Hello i am facing the following… Two DB tables (mysql myisam tables – no

  • 0

Hello i am facing the following…

Two DB tables (mysql myisam tables – no foreign key constraints) ‘MASTER’ and ‘CHILD’. Rows in ‘CHILD’ db table reference a single row (1:M) in the ‘MASTER’ table using the parent_id *column*.

The problem is that the parent_id column has 2 “types” of values:

  • A NON-ZERO value referencing a row in the ‘MASTER’ table
  • A ZERO value meaning that the row is not referencing the ‘MASTER’ table. In this case rows with ZERO values in the parent_id column ‘actually mean’ something else => represent different type of data (stored in the same table? i.e storing apples and oranges in the same table when the two might be best to be stored in different table)

I am confused. Is this simply a bad database design? Is it common practice to differentiate ‘what rows in a DB table represent’ using different values in a column which is used to reference ‘parent rows’ in another table.

If you are not confused and can help, please do 🙂

  • 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-05-23T09:18:46+00:00Added an answer on May 23, 2026 at 9:18 am

    When you are discussing what rows in a table “actually mean”, you are crossing the line from logical data modeling into conceptual data modeling, the semantics of the data. In general, storing rows of two different types with regard to actual meaning in one table is a bad idea.

    It’s a bad idea from the point of view of speed, because most of your queries are going to involve extra disk io to weed out rows that don’t pertain to the current query.

    It’s a bad idea from the point of view of producing bug free code, because it you forget to weed out rows that don’t pertain, you’ll get wrong results.

    It’s a bad idea from the point of view of flexibility, because data that is inappropriately bound together is harder to alter when the requirments change.

    It’s bad design.

    Having said that, there are optional FK fields in well designed databases. In such cases, the rows that opt out of the relationship contain NULL, not zero in the cell. However, even in such cases, the semantics of the remaining columns isn’t affected by whether the relationship is present or absent.

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

Sidebar

Related Questions

Hello guys i'm facing a isolated exception when trying to edit my UI it
Hello to all I am here facing some situation of detecting url in asp.net
Hello I have like this 2 tables class User public int UserId{get;set;} { ....
hello i am facing this stupid issue with no help any where. i am
I'm trying to run the following code but unfortunately facing Error problems package jskypeexample;
Hello stackoverflow Community, I am currently facing a problem with the jQuery mobile slider.
Hello i have a simple search query, what i'm facing is when someone writes
I'm facing the following issue. I have a view with a UINavigationBar (not NavController)
Hello i am using following xml to create some sort of Transparent panel .
hello every one i am facing a strange problem i my code i am

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.