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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:45:34+00:00 2026-05-31T13:45:34+00:00

In MySQL, is it bad to have a table structure like the following… Table

  • 0

In MySQL, is it bad to have a table structure like the following…

Table stuffA
ID

Table stuffB
ID

Table superStuff
ID
type
stuffID

…where depending on the value of superStuff(type), superStuff(stuffID) could reference either stuffA(ID) or stuffB(ID) ?

Thanks, in advance, for your help

  • 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-31T13:45:36+00:00Added an answer on May 31, 2026 at 1:45 pm

    I think you mean the other way around:

    Table stuffA
    ID
    superStuffID
    
    Table stuffB
    ID
    superStuffID
    
    Table superStuff
    ID
    

    Besides you don’t need the type attribute because it is implicit when you query one table or the other.

    NOTE: I’m assuming you also have other fields on the tables and that you’ve ommited them in order to make a minimal example. If this is not the case, probably you wouldn’t need a hierachy there.

    This answer might be helpful in understanding this.

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

Sidebar

Related Questions

I have a MySQL 5.1 InnoDB table ( customers ) with the following structure:
I have a MYSQL Table with the following structure called daily_measurements +------------+----------+------+-----+---------------------+----------------+ | Field
If I have an array like: $b=array(1,6,8,9); and I also have a mysql table
I have the following table structure. One table EQUITIES and a table for each
I have a MySQL table like this : mysql> SELECT ID, Username, Parent, LeftNum,
MySQL specifies the row format of a table as either fixed or dynamic, depending
Mysql: Table_A ------------ id name 1 Name1 2 Name2 Table_B ------------ a_id type value
We have a mySQL database table for products . We are utilizing a cache
I have a MySQL table that records classified listings. We don't force users to
I have a MySQL table with a field named description , with a record

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.