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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:51:14+00:00 2026-06-08T01:51:14+00:00

Im getting back into database design and i realize that I have huge gaps

  • 0

Im getting back into database design and i realize that I have huge gaps in my knowledge.

I have a table that contains categories. Each category can have many subcategories and each subcategory can belong to many super-categories.

I want to create a folder with a category name which will contain all the subcategories folders. (visual object like windows folders)
So i need to preform quick searches of the subcategories.

I wonder what are the benefits of using 1:M or M:N relationship in this case?
And how to implement each design?

I have create a ERD model which is a 1:M unary relationship. (the diagram also contains an expense table which stores all the expense values but is irrelevant in this case)

1:M unary relationship

is this design correct?

will many to many unary relationship allow for faster searches of super-categories and is the best design by default?

I would prefer an answer which contains an ERD

  • 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-08T01:51:17+00:00Added an answer on June 8, 2026 at 1:51 am

    If I understand you correctly, a single sub-category can have at most one (direct) super-category, in which case you don’t need a separate table. Something like this should be enough:

    enter image description here

    Obviously, you’d need a recursive query to get the sub-categories from all levels, but it should be fairly efficient provided you put an index on PARENT_ID.

    Going in the opposite direction (and getting all ancestors) would also require a recursive query. Since this would entail searching on PK (which is automatically indexed), this should be reasonably efficient as well.

    For some more ideas and different performance tradeoffs, take a look at this slide-show.

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

Sidebar

Related Questions

I'm getting back into web design after a several year break, so a lot
I have a problem. I have a view that is getting back no results
I'm getting back into .NET development after a couple years and it seems that
gcc I am just getting back into c programming and I am just practicing
I wrote a huge iPad app 2 years ago and now I'm getting back
Good afternoon, I'm having serious troubles getting my database back up and running. I
I have a database that consists of 5 tables : Course, Category, Location, CourseCategories,
I have some problems getting the custom formated JSON data into a dijit.form.FilteringSelect. It
I'm currently working on a project that's based on Android. Without getting into many
I'm running into an issue with a join: getting back too many records. I

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.