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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:29:02+00:00 2026-05-23T05:29:02+00:00

I could really use some insights on choosing between the following two database layouts.

  • 0

I could really use some insights on choosing between the following two database layouts.

Layout #1          | Layout #2  
                   |  
CUSTOMERS          | CUSTOMERS  
 id int pk         |  id int pk  
 info char         |  info char  
                   |  
ORDERS             | ORDERS  
 id int pk         |  id int pk  
 customerid int fk |  customerid int fk  
 date timedate     |  date timedate  
                   |  
DETAILS            | INVOICES  
 id int pk         |  id int pk  
 orderid int fk    |  orderid int fk  
 date timedate     |  date timedate  
 description char  |  
 amount real       | DETAILS  
 period int        |  id int pk  
                   |  invoiceid int fk  
                   |  date timedate  
                   |  description char  
                   |  amount real  

This is a billing application for a small business, a sole proprietor. The first layout has no separate table for invoices, relying instead on the field ‘period’ in DETAILS for the billing cycle number. The second layout introduces a table specifically for invoices.

Specifically in this application, at what point do you see Layout #1 breaking, or what kind of things will get harder and harder as the amount of data increases? In the case of Layout #2, what does the added flexibility/complexity mean in practical terms? What are the implications for 30-60-90 aging? I’m sure that will be necessary at some point.

More generally, this seems to be a general case of whether you track/control something through a field in a table or a whole new table, yet it’s not really a normalization issue, is it? How do you generally make the choice?

  • 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-23T05:29:03+00:00Added an answer on May 23, 2026 at 5:29 am

    Given the previous comments, this is how I would approach it:

    CUSTOMERS
      id int pk
      info char
    
    CASES
      id int pk
      customerid int fk
      dateOpened datetime
      dateClosed datetime
      status int <- open, closed, final billed, etc.
      BillPeriod int <- here is where you determine how often to bill the client.
      BillStartDate datetime <- date that billings should start on.
    
    BILLING
      billingid int pk
      caseid int fk
      userid int fk <- id of person who is charging to this case. i.e. the lawyer.
      invoicedetailid fk <- nullable, this will make it easier to determine if this particular item has been invoiced or not.
      amount money
      billdate datetime
      billingcode int fk <- associate with some type of billing code table so you know what this is: time, materials, etc.
      description char
    
    
    INVOICES
      invoiceid int pk
      customerid int FK
      invoicedate datetime
      amount money <- sum of all invoice details
      status int <- paid, unpaid, collection, etc..
      discount money <- sum of all invoice details discounts
      invoicetotal <- usually amount - discount.
    
    INVOICEDETAILS
      invoicedetailid int PK
      invoiceid int FK
      billingid int FK
      discount money <- amount of a discount, if any
    

    ===========

    In the above you open a “case” and associate it with a customer. On an ongoing basis one or more people apply Billings to the case.

    Once the combination of the bill start date and period have elapsed, then the system will create a new Invoice with Details copied from the Billing table. It should do this based on those details that have not already been billed. You should lock the billing record from future changes once it has been invoiced.

    You might have to change “BillPeriod” to some other type of field if you need different triggers. For example, period is just one “trigger” to create an invoice.

    One might include sending an invoice when you hit a certain dollar amount. This could be configured at the customer or case level. Another option is capping expenditures. For example putting a cap value at the case level which would prevent billings from going over the cap; or at the very least causing an alert to be sent to the relevant parties.

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

Sidebar

Related Questions

I could really use some help with the following SQL Select statement scenario: I
After two days of searching, I'm stuck and could really use some assistance. I
This seems to be an overlooked area that could really use some insight. What
I've been fighting this problem for many hours now and could really use some
I've inherited a rather large application that really could use some cleanup. There is
I have a piece of code here that i really could use some help
I could really use some clarification as to how using a random salt protects
I could really use some help optimizing a table on my website that is
I have been struggling with this for a while and could really use some
I really could use some help in the right direction with this. Thanks!

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.