D
D
DieZz2015-03-10 19:17:58
MySQL
DieZz, 2015-03-10 19:17:58

How to organize the table(s)?

There is an "equipment" entity with attributes: model, manufacturer, serial number, etc.
Each entity can be located in one of several warehouses, at an employee's, or at a communication center. How to properly organize a relational database for such an entity?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Entelis, 2015-03-10
@DieZz

If employees, warehouses, communication nodes are different entities within the database, you need a table like:
device_id, storage_type, storage_id
where storage_type - indicates in which table to look for storage_id

D
Dmitry Filyushin, 2015-03-10
@Filyushin

Tables:
equipment, directory of warehouses/storage locations, storage.
The storage table contains an equipment code and a warehouse code, add a unique index to two fields to prevent equipment from being stored in two places at the same time.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question