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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:51:43+00:00 2026-05-20T07:51:43+00:00

Consider, please this setup for a database backed application. ( in my case DB

  • 0

Consider, please this setup for a database backed application.
( in my case DB is MySQL and app is in Ruby ( Rails 3), but I don’t think it matters for this question)

Let’s say I have an app for a warehouse.

I have multiple items that would have categories and statuses.

For example table that has parts would have a few statuses such as: in stock, discontinued, backordered and multiple categories, such as: it hardware, automotive, medical, etc.

Also I have other tables that need statuses and categories, such as
Vendor: approved, out of business, new
Order: Open, processes, shipped, canceled.

Etc.

Here is the question:

I think if I wanted to properly normalize my db – I would have a table called categories, categories_types, statuses, statuses_types.

Then I would store all categories in that table, and any category that is of a certain type, such all categories of parts, would have a foreign key to category_type – parts, and so on. Same for types.

This is the normalized way.

However I often see that people create separate tables for specific categories, for example,
there would be a table called part_categories, vendor_categories, order_statuses, part_status. This is a less normalized db, but I guess when you are dealing with a lot of tables, it might be clearer.

Which of this approaches is a better one? What are the cons & pros in your experience?
I usually go with the first setup, but I see the second one so often that I’m beginning to doubt my approach.

Thank you.

  • 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-20T07:51:44+00:00Added an answer on May 20, 2026 at 7:51 am

    In my experience, tables of enumerated names invariably evolve into their own full-fledged model eventually. Typically, it begins by adding boolean flags, or as mentioned in the answer above, referent types or valid date ranges.

    From a relational perspective, neither approach – putting all status enums in one table, or breaking them into separate tables – is “more” normalized than the other. But from a type-theoretic standpoint, it makes more sense to put part_categories and vendor_categories in their own separate tables, for no other reason than it requires no code in the model to make sure you don’t accidentally associate a vendor category with a part.

    If you do end up putting them all in the same table, Rails has a nice feature called polymorphic associations that will automate the type and the id columns for you. It’s a reasonable compromise between the two approaches.

    Most importantly, I would contend that the enums will eventually take on a model life of their own, in which case you have a very messy job of finding all of them in the various tables, and recasting them in their own table. Tables are cheap; why be frugal with them?

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

Sidebar

Related Questions

Please consider this example class: [Serializable] public class SomeClass { private DateTime _SomeDateTime; public
This is a complex question, please consider carefully before answering. Consider this situation. Two
Please consider the following: <td style=width: 500px;> <div style=width: 400px;>SomeContent</div> </td> For some reason,
Please consider the following fork() / SIGCHLD pseudo-code. // main program excerpt for (;;)
Please consider the following scenario: map(T,S*) & GetMap(); //Forward decleration map(T, S*) T2pS =
C#: What is a good Regex to parse hyperlinks and their description? Please consider
Consider the following setup: A windows PC with a LAN interface and a WiFi
Consider the need to develop a lightweight desktop DB application on the Microsoft platforms.
Consider this problem: I have a program which should fetch (let's say) 100 records
Consider: List<String> someList = new ArrayList<>(); // add "monkey", "donkey", "skeleton key" to someList

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.