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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:40:08+00:00 2026-06-17T03:40:08+00:00

This is what is the best practice question. I have 3 tables: orders, customer

  • 0

This is “what is the best practice” question.

I have 3 tables: orders, customer and address.

Order
------
ID
ADDRESS_ID


Customer
------
ID


Address
------
ID
CUSTOMER_ID
IS_HIDDEN

User can have multiple address and is free to edit them at any time. When user places an order I need to store a “snapshot” of his address at that time, associate it with the order and make it unavailable to the user. In other words, I want to duplicate address row which will be owned by Order table instead of Customer. This ownership needs to be somehow indicated (for example with IS_HIDDEN flag).

Is this correct approach that some data from address table is sometimes “owned” by a Customer table and sometimes by “Order”?.

The other solution would be replicating all columns from Address table in Order so the ownership will be explicit but I have bad feelings about duplication in schema.

  • 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-06-17T03:40:09+00:00Added an answer on June 17, 2026 at 3:40 am

    If you really want a snapshot of the address you should probably store the address in the order, not a separate table.

    You would be making your queries and data unnecessarily complicated.

    And with the implementation you are describing you would get duplication anyway.

    Example:

    Customer Address = 1 street

    Customer places order the address is hidden in the table.

    Customer places another order with the same address. The address is
    saved and hidden in the table.

    The final result would be:

    Customer ID | Address  | Hidden  
        1       | 1 street |  false  
        1       | 1 street |  true  
        1       | 1 street |  true  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a best practices question Let say, I have a class object, like
This is basically a 'best practices' question. Struts 1 forms have getters and setters
This is a 'best practice' question. I want to play with the look and
This is a very generic 'best practice' question, but here's an example. Let's say
This is a beginner-best-practice question in perl. I'm new to this language. The question
My question is that is this the best practice to do this. Couldn't find
This is more or less a best-practice question: I'm working on a site that
Say I have two tables (I am using Django, but this question is mostly
This is an efficiency/best practice question. Hoping to receive some feed back on performance.
I have a question about what would be the best practice for creating 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.