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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:02:10+00:00 2026-05-17T17:02:10+00:00

This is not a homework, but new task assign by superior. To create a

  • 0

This is not a homework, but new task assign by superior. To create a system for in-house end-users, which auto suggest to different assembly line based on each line’s capacity. Users need to maintain each line capacity everymonth, and each line have its own product group running on it with unique prority on each assembly line. When the sales order coming, this system will based on the line planning maintenance below to do auto allocation to each assembly lines based on prority setting.


Eg, Product A which is under product group XYZ will be running at L1 and L2.
Sample Data
Period | Line_Number | Product_Subgp | Line_Capacity | Prority
201009 | L1 | XYZ | 2000 | 1
201009 | L1 | ABC | 2000 | 2
201009 | L2 | XYZ | 2000 | 2
201009 | L2 | ZZZ | 2000 | 1


Table Structure for Line Header : LinHdr

Line_Hdr_ID | Int(AutoIncrement)
Line_Number | VarChar(10)[Primary Key]
Period | VarChar(6) [Primary Key]
Capacity | Numeric(16)
Special_Capacity| Numeric(16)
Line_Description| VarChar(20)


Table Structure for Line Header : LinDtl

Line_Dtl_ID | Int(AutoIncrement)
Line_Hdr_ID | Int [Primary key]
Product_Group | VarChar(10)[Primary Key]
Prority | Numeric(2)


Questions:

  1. Table LinHdr: Line_Number+Period is Primary Key. As these 2 fields will be act as uniqueness and as a seekkey of the data. Am i correct to set both as primary key?

  2. Table LinHdr: Need to include Lin_Hdr_ID as primary key?
    (LinHID which is autoincrement by SQL, will be invisible to users).

    • The purpose of LinHID is to link to LinDtl, so that no need to include redundant data (i.e. Period+Line_Number) into LinDtl, by using Lin_Hdr_ID to link betw 2 tables.
  3. Table LinDtl: Line_Hdr_ID+Product_Group will set as Primary Key, to enforce uniqueness.
    Is this correct to have this Line_Dtl_ID?
    Is this field necessary?
    If Line_Hdr_ID+Product_Group already provide uniqueness, can exclude Line_Dtl_ID?

  4. Or, it is better to combine 2 tables above into 1 tables, which did not create relational database?

Hope can have advice from expertise here.

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-05-17T17:02:10+00:00Added an answer on May 17, 2026 at 5:02 pm

    1.1. Line Hdr Id is set to autinc – make that the PK. YOu can search on fields w/o them being PK. If they are unique together, then make index on them – need to make them PK and have to then use it as a FK – long key! plus I personally do not like putting dates into PKs

    1. See # 1 above — and, you answered your own question !

    2. If you want a concat/composite PK in InDtl then make it LinHdr_id + Lin Dtl Id – this is the “proper” way of doing an identifying relationship.

    3. Do not combine tables this will violate 3rd normal forms.

    4. COnsider reading a book: Entity Relationship Modeling by Richard Barker.

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

Sidebar

Related Questions

I was tasked as a homework assignment to make a task tracker. I wanted
This is from Sun's tutorial's exercise area so I suppose it is homework. I
yes this is one of my homework projects - to implement a Circular Linked
I'm new to C++, and preparing a homework by using NetBeans IDE on Ubuntu
It is homework question. Question: Use an array of integers with size 10 and
I am working on a homework assignment, beginning C#. Have to accept input from
Ok so I'm working on my homework and am having trouble figuring out how
I'm sitting at college making a noughts and crosses game while everyone else is
If the number 5 is given to us, it needs to be printed out

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.