T
T
tukreb2019-10-07 13:50:54
Database design
tukreb, 2019-10-07 13:50:54

What is the best way to design a R-model of a database in this situation?

Good day everyone!
There is a small snag on how best to design a R-model for entities that are PC components and that are stored in a warehouse.
As an example, there are 4 entities - CPU Model, RAM Model, Disk Model and the warehouse itself (other models will be omitted).
Each of them has specific parameters, so I do not see how to generalize this into one general entity.
Example #1 (composite key circled in red) blue attributes - foreign key:

Example #1
5d9b144054cd7248507316.png

Example No. 2, one of the first blunder options was this:
Example #2
5d9b148c04308728210332.png

Well, as is obvious in such an entity (example No. 2), it is difficult to maintain data integrity (more precisely, you need to remember this).
Question to people with experience, is there a better option in this situation? Will he stop at example No. 1 or is there a more elegant and universal solution?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
VicTHOR, 2019-10-07
@tukreb

Entity and relationship table
The table describes EQUIP, which has a CPU, which is also described in a separate table, so a link to a line in that table. That's relational relationships.
If you need to describe the warehouse, add WAREHOUSE_ID - a link to the warehouse table

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question