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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:21:34+00:00 2026-06-12T15:21:34+00:00

I am using MySQL DBMS .I have Document table and Order table .The relationship

  • 0

I am usingMySQL DBMS.I have Document table and Order table.The relationship between them is one to many.

When document is created user can insert some orders to Order table for that document.
It takes effect to table when user clicks the register button.But after, a user can edit that document.He/She can change,update,delete orders.

When register button clicked it will effect to the Order table.When editing I want to delete all orders for that document,then insert again.But it does not seem to me good,for example,if there are 100 orders and user only changes 1 row,I have to delete 100 rows and insert 100 rows again,or if user adds new order ,I have to delete 100 rows and add 101 rows.

What is the best way to handle this situation?Note that I am using C#.Thanks in advance.

  • 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-12T15:21:35+00:00Added an answer on June 12, 2026 at 3:21 pm

    You should create a new record for the document whenever there is a change in the document. You can use a unique identifier for document and then version the document. Each order should be related to a particular version of document.

    This way, you can edit the document and whenever you edit the document a new version is created and fresh orders will be for that version. The unique identifier of all the version will remain same. In short, the document will be identified by unique identifier and version.

    Your suggested method has a problem, i.e. when you modify the document, you will re-insert all the orders but you will never be able to trace back the original document for which the orders were.

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

Sidebar

Related Questions

Using MySQL, when I have a table with (for example) three keys (one primary,
Using MySQL, How do I import a user defined database function from one db
Using MySQL, I have a simple table that logs the IP Address that users
Using MySQL and I have data being loaded into a table every second. I
Using MySQL 5 I have a table like this: date (varchar) door (varchar) shift
USING MySQL. I have two tables. Table A, and Table B. Table A has
Using MySQL, I have table Table 1 Id D -------- A 100 A 125
Using MySQL I have table of users, a table of matches (Updated with the
(Using MySQL and PHP) I have a search form that will allow my users
Using MySQL, I have three tables: projects : ID name 1 birthday party 2

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.