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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:27:02+00:00 2026-05-29T23:27:02+00:00

I come from frontend background, so I apologize if this db question seems dumb.

  • 0

I come from frontend background, so I apologize if this db question seems dumb.

Say I have a database that handles orders of car and car accessories. If Car is non-customizable, then everything is easy-peasy. For every order, we simply need to associate the OrderId with the Car‘s ProductId. But a Car is a Product that can contain one or more Product like navigation, seat heater, etc. And users can also purchase those accessories Product separately.

How should we handle this best? Should every Product a user orders be given a unique ProductOrderId in the order table and if that Product can contain another Product, then we put it in a table that associates ProductOrderId with ProductId?

If we do this, would the db grow out of control? Seems a little inefficient to me. I have a feeling there is a better way.

  • 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-29T23:27:04+00:00Added an answer on May 29, 2026 at 11:27 pm

    If you look at how complex products are typically billed, the main item and each of its options are treated as separate line items in the bill of sale. In that kind of scenario, a car is a product and each of its accessories are also products. You can have an involuted relationship on product to indicate which accessories go with which type of car.

    Your data model for this scenario would look something like this:

    enter image description here

    Alternatively, you could have a scenario where you want a level of abstraction such that your bill of sale contains only a single item, being a fully accessorized car. That requires the order item to become more like a header in a bill of materials, like so:

    enter image description here

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

Sidebar

Related Questions

I come from a Codeigniter MVC background that we've been working with for some
I come from a Java background, where packages are used, not namespaces. I'm used
I come from a mainly PHP background and make good use of the Apache
I come from a CVS background. I'm currently investigating using SVN for a project.
I come from a background of MoM. I think I understand ESB conceptually. However,
I come from classes object orientation languages and recently I have been learning those
I come from more of a Java background. In the last year or two,
I come from a Java background and with any servlets-based technology, it's trivial to
I come from a linux/apache/php/mysql background. For my current project, I am forced to
Let's say you have a bug that was found in functional testing of a

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.