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

  • Home
  • SEARCH
  • 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 7539119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:17:56+00:00 2026-05-30T07:17:56+00:00

I have a product table called products It has 3 fields (name,model(PK), and class_name).

  • 0

I have a product table called products
It has 3 fields (name,model(PK), and class_name). The class corresponds to a table.
So here is an example:

Product table:

model | name | class_Name
z123  | Abcd | AMPS

AMPS table:

model | attribute_1 | attribute_2
z123  | blah blah   | blah blah

Question:

Should I have a table that holds the PK (model) and its corresponding class name, and then use the class ID in my product table? Would it be more efficient to have a table that holds all of the model’s and their classes?

  • 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-30T07:17:57+00:00Added an answer on May 30, 2026 at 7:17 am

    This looks like a “subclass” (aka. “category”) hierarchy. If you have and always will have only AMPS and no other “child class”, then you may consider merging it with Product. Otherwise, it looks good.

    BTW, there are 3 ways to implement class hierarchies in relational databases, each with strengths and weaknesses. Keeping all classes in a single table is one of them, but can be hard to maintain and can be problematic for certain kinds of referential integrity. The model that you are already using (“class per table”) should probably be your default choice unless there is a compelling reason otherwise…

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

Sidebar

Related Questions

I have model called Product and it has the following columns: create_table :products do
I have a table called Products in my database. It has a couple of
Hey, I have a table called products that has a relationship with itself. This
I have a table called Product and a table called Shop. Each shop has
I have a SQL Server 2008 database. This database has a table called Product,
I'm using C#. I have a products class with fields like sku, name, description....
I have one table called: Transaction. This table has the following fields: (ID,ProductName,Amount,Date) placed
I have a Table called Product and I have the Table StorageHistory . Now,
I have a table called products containing a field called price and I simply
I have a products table with a column of type SET (called especialidad), with

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.