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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:13:56+00:00 2026-06-09T18:13:56+00:00

I am new to SQL and I have a question regarding table relationships. Currently,

  • 0

I am new to SQL and I have a question regarding table relationships. Currently, I have the following tables in my database:

Person:

Person_ID (PK)
Name
Company_ID(FK)
Phone
Email

Company:

Company_ID (PK)
Name
Address
City
State
Invoice_ID (FK)

Invoice:

Invoice_ID (PK)
Summary_ID (FK)
Detailed_ID (FK)

Summary_Section:

Summary_ID (PK)
InvoiceNumber
Date
DueDate

Detailed_Section:

Detailed_ID (PK)
Person_ID (FK)
Amount
Info

Basically, each company has multiple people and receives one invoice.

Each invoice is broken into two sections:

  • Summary
  • Detailed

The summary section shows the company name, company address, invoice number, invoice date, & due date.

The detailed section shows the person’s name, amount, & additional info.

Am I going about this all wrong? What would be the best way to go about this? Thank you!

EDIT:

Concern: Am I assigning the foreign/primary keys correctly in this scenario?

  • 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-09T18:13:58+00:00Added an answer on June 9, 2026 at 6:13 pm

    The PK/FK assignment seems to be ok. Although I would suggest the following:

    1. If you are using any kind of framework, try to be consistent with its conventions. For example, Ruby on Rails usually calls the primary key (if it is just one column) as id for all tables. Note: column names across tables don’t have to be unique.
    2. Do you really need to separate the summary and detailed sections in the DB? You could combine the Invoice, Summary, and Detailed in one table, and then just retrieve/display the columns you need. This is both a design and engineering issue.
      • Design: Can two invoices ever share a section?
      • Engineering: How many times do you think the sections might be edited/retrieved?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question regarding performance of SQL Server. Suppose I have a table
I have a question regarding my attempt to combine two tables in sql server...
I`m new to sql and have been stuck on the following issue for almost
I'm pretty new to SQL. I have a database with records based on road/milepoints.
I'm very very new to sql server. I want to have a table with
I have a simple question regarding T-SQL. I have a stored procedure which calls
I am new to SQL and I have a basic question about performance. I
I'm relatively new to SQL so forgive my ignorance... I have three tables, SRS_CAP,
i am new to SQL and i have a small question. i am writing
Hi, I'm new to both Prism and WPF, and I have a question regarding

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.