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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:57:12+00:00 2026-05-23T02:57:12+00:00

I want to know how to design invoice table. An invoice include many orders

  • 0

I want to know how to design invoice table.

An invoice include many orders from order table.

Is this invoices table is correctly designed?

order

  • order_id (PK)
  • User_id (FK)
  • total_cost
  • order_date
  • status

order_item

  • order_item_id (PK)
  • order_id (FK)
  • item_name
  • cost

invoice table

  • invoice_id (PK)
  • invoice_no
  • invoice_date
  • period_start_date
  • period_end_date
  • status

invoice_order (an invoice with many orders)

  • invoice_order_id (PK)
  • invoice_id (FK)
  • order_id (FK)

Is invoice_order table necessarry?

I could add invoice_id (FK) field in the order_table instead. The “order. invoice_id” would be updated when I have added a row in the invoice table.

  • 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-23T02:57:13+00:00Added an answer on May 23, 2026 at 2:57 am

    You need the linking table. An order can be in mulitple invoices (if they didn’t pay it!) and an invoice can contain many orders. In a linking table though I would not bother with •invoice_order_id (PK). The PK is a combination of the two FK fields. That guarantees uniqueness and since you are unlikely to have a child table of the link table, you really gain nothing by adding a surrogate key to it. Even if you did the performance difference between joining on two indexed int fields vice one would probably be negligible.

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

Sidebar

Related Questions

This question is more towards Design and Architecture and I want to know SO
As an exercise in good OO methods and design, I want to know what
I've got some questions regarding Java design patterns. I want to know what the
I want to know how to design a Flash CS4(AS3) based kiosk application where
I want to know is there any software design the schema of oracle database?I
I want to know when should developers read and learn about design patterns? Is
Summary: I want to know the best design for creating cross-platform (eg. desktop, web,
I want to know which is the best architecture to adopt for this case
Now, I know this question is very opinion oriented because people generally design their
okay. so I want to know how to make game 3D models and design

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.