0

Currently, I am trying to figure out what is a suitable way to design a data model about parts and processes that are needed to fabricate the parts. Several processes must be carried out by different machines. Sometimes two or more different processes must be carried out by a single machine along with other processes conducted by other machines.

For example, there are three different kinds of machines, m1, m2, and m3. Each of them can carry out different processes that differ in machine settings. My current idea is the use of the following tables:

CREAT TABLE m1 (m1-process-id, setting 1, setting 2, etc.)
PK m1-process-id

CREAT TABLE m2 (m2-process-id, setting 1, setting 2, etc.)
PK m2-process-id

CREAT TABLE m3 (m3-process-id, setting 1, setting 2, etc.)
PK m3-process-id

CREAT TABLE parts (part-id, other information about a part)
PK part-id

CREAT TABLE processes (process-id, m1-indicator, m2-indicator, m3-indicator)
PK process-id
if mx-indicator (x means 1, 2 or 3) is 0, it means that the corresponding machine is not involved. 
One of the mx-indicator is set to the corresponding mx-process-id for the table m1, m2 or m3.

CREAT TABLE ProcessPart (process-id, part-id)
PK (process-id, part-id)
FK process-id form processes table and part-id from part table

I am not sure if I have made the right decision about the data model. Does anyone have some suggestions?

Xifang
  • 1
  • 1
    "any suggestions" is not a valid SO question. Re "is this right": Show the steps of your work following your reference/textbook, with justification--we don't know exactly what algorithm/method you are following & we want to check your work but not redo it & we need your choices when an process allows them & otherwise we can't tell you where you went right or wrong & we don't want to rewrite your textbook. Please see [ask], hits googling 'stackexchange homework' & the voting arrow mouseover texts. If you're not sure, ask 1 specific researched non-duplicate question re where you got stuck. – philipxy Jun 23 '20 at 09:21
  • SQL/DB subtyping/inheritance/polymorphism idioms is a faq. [How can you represent inheritance in a database?](https://stackoverflow.com/q/3579079/3404097) [How do you effectively model inheritance in a database?](https://stackoverflow.com/q/190296/3404097). Please before considering posting read your textbook and/or manual & google any error message or many clear, concise & precise phrasings of your question/problem/goal, with & without your particular strings/names & site:stackoverflow.com & tags; read many answers. – philipxy Jun 23 '20 at 09:22
  • 1
    Thank you for your hints and critics. Sorry for the misbehavior. I am new to StackOverflow and also to the area database. I will learn how to use SO more appropriately. – Xifang Jun 23 '20 at 10:00

0 Answers0