Results 1 to 4 of 4
  1. #1
    AlohaT is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2014
    Location
    Hawaii
    Posts
    2

    Best way to set up new database to track customer orders

    Hello:
    I have basic training in Access 2010. I'm an Administrative Assistant in a small perfumery company (on-line business) and my boss has asked me to set up a basic database to track product samples that are mailed to each customer with their order. He wants to know what perfume samples are given to each customer. Mostly he wants to know If the same customer orders more than one time and request the same sample over and over again at different dates, could I set up something to track that?



    So far I have created 2 tables: Products Table (containing all the sample products we have), Customer Table (containing customer info), and I'm working on the Order History table (not sure what to include there yet)
    My problem is that I'm not sure if that would be the best way to set it up and how create a relationship between these tables so that I can easily find the information he needs.

    Any help would be so much appreciated. Thank you in advance for your time.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Sounds about right. Just be sure to take advantage of the Autonumber field for primary key values. Store the PK's in foreign key fields in your events table, the table that will record customer orders. Your events table will have FK's for the Product and customer.

    Now the tricky part. One order may contain a request for more than one product. In this case you need to be prepared. One approach for this "Many to Many" relationship is to use a "Junction" table. My preference, when considering orders, is to have a "Purchase Order" table behave as the junction table. The Autonumber field in the PO table can be used internally as an order reference number.

    So, your events table will also have an FK to store the Purchase Order PK.

  3. #3
    AlohaT is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2014
    Location
    Hawaii
    Posts
    2
    Hello ItsMe, thank you so much for your help. Just have a few questions to help me understand better:
    1. You said to store the PK's in foreign key fields in the events table. Did you mean to store the PK's AND foreign key fields in the events table?
    2. I will create a Purchase Order/Purchase History table to use it as my junction table (many to many relationship).
    3. Would I need to create a fourth table called Events Table and have a FK to store the Purchase Order PK?

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I am posting with my phone but I will try to answer your questions.
    When I think of PK vs. FK, I consider "Key" to be the common denominator. If 200 is the PK in one table, then that same 200 will be the FK in another table. The join between the two tables indicate there is. a relationship. One sine of the relationship will be the primary and the other side will be the foreign.

    Go ahead and create a purchase order table.

    Create a "fourth" table.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 12-11-2013, 09:27 PM
  2. Replies: 7
    Last Post: 12-10-2013, 02:45 PM
  3. Replies: 7
    Last Post: 10-23-2012, 04:50 PM
  4. Replies: 5
    Last Post: 08-08-2012, 05:35 AM
  5. Parts/Work Orders Database Design
    By snewton in forum Database Design
    Replies: 5
    Last Post: 03-13-2012, 07:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums