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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:10:55+00:00 2026-05-11T19:10:55+00:00

I am designing a simple auto parts database for my friend to learn more

  • 0

I am designing a simple auto parts database for my friend to learn more about database design. I was stuck with the ORDER, ORDERITEM, SHIPMENT, PACKING LIST, INVOICE and CONTAINER relationship.

The ORDER contains ORDERITEM which is individual parts (can be more than one in amount on one entry). When all or part of ORDERITEM are available, SHIPMENT will happen. For each shipment, multiple PACKING LISTs are possible. For each PACKING LIST, one INVOICE is needed. A PACKING LIST will contain one or more CONTAINERs and inside each CONTAINER there will be at least one ORDERITEM.

I don’t know if it is a good idea to split data into above tables, and what is a better way to connect them together?


EDIT:

Here is my draft of the database design: http://www.flickr.com/photos/oldyoungguy88/3595283724/sizes/o/

There are two parts. One is PARTS table for ‘inventory’ and one is CUSTOMER, ORDERS, INVOICES, SHIPMENTS tables for ‘documents’.

  • 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-11T19:10:55+00:00Added an answer on May 11, 2026 at 7:10 pm

    What your talking about is called normalization, and what you need to do that is a foreign key. Wikipedia article on Foreign Keys This is great approach, and can help you organize things efficiently in the database.

    There is also a really good article on database normalization over here, that appears to describe this better then what I can do. Below follows my stab at describing what you want to do.

    If you have a one to many relationship, the items can be stored in different tables. Let’s say that we have the following ORDERTABKE. I’ve added a primary key to the ORDERTABLE so that I have a distinct Identifier for each row in the table. Wikipedia article on Primary Keys

    OrderID - Primary Key
    OrderDate
    OrderStatus
    etc...
    

    Your table for OrderItems could then look like

    OrderItemID - Primary Key
    OrderID - Foreign Key
    PartDescription
    Qty
    

    The ORDERITEM table is linking to the ORDERTABKE since it has a foreign key to the OrderID of the parent row. So, each OrderTable can have one or more OrderItems that link to it. You could even put your parts in their own table such as PARTS. That way, you only have to store the parts descriptions once, and can make your OderItem table as simple as possible.

    Also, just because a table has a foreign key, does not mean it can’t have a primary key that another table references through it’s foreign key. It’s also possible to go crazy with normalization to where it starts make it difficult to code for. When you should and should not normalize your data is something that you learn through trial and error.

    I would recommend reading some references on database design and normalization. There are numerous books on this topic. Try to find one that focuses more on practical examples then the theory behind why you do that.

    I hope this helps.

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

Sidebar

Related Questions

I am designing a simple database of online exam system. But I can not
I was designing a simple pos application but I got stuck on a problem.
I am designing a simple registration form in ASP.net MVC 1.0 I want to
i am designing a simple project based to do list. the idea is to
I'm designing a simple messaging schema where a thread groups all messages that are
I am designing a simple web-based application. I am new to this web-based domain.I
Right now I'm building a simple form and I'm designing it so that if
I have what is most likely a very simple question.. I am designing a
Okay, so I'm designing this site. Here's the HTML markup of this simple element:
I'm designing a fairly simple web site but as I don't have much experience

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.