Each employee has equipment attached to him, each equipment has its own list of attached documents, the assigned equipment is located in a specific place.

As I was told, intermediate tables are needed (equipment list and document list). How to tie them?

scheme itself

  • Three main tables: equipment, documents, employees. and in order to store connections you can create: equipment_documents, equipment_stafflers. - Stack
  • one
    in the table equipment_documents will be: [equipment.Id], [documents.id]. similarly in another table. You can also add the date - to make it clear when the connection was created. - Stack
  • so it will be right? - Alexey
  • those. With such a scheme for each employee can hang several types of equipment and each equipment can have several documents? - Alexey

1 answer 1

Response from Stack comments

Three main tables:

  • equipment,
  • documents,
  • employees.

In order to store relationships, you can create two intermediate tables:

  • equipment_documents,
  • equipment_state

In the table equipment_documents there will be the following foreign keys: [equipment.Id], [documents.id]. Similarly, in the equipment table, the staff will have the following foreign keys: [equipment.Id], [employees.id]. You can even add the date - to make it clear when the connection was created.