R
R
Roman Rakzin2018-03-04 19:25:49
MySQL
Roman Rakzin, 2018-03-04 19:25:49

How to store sequence of data in database?

There are lists of employees. The user can change the sequence.
How best to keep the sequence of employees and how to keep a history, for example, that at such and such a time in such and such a room, first there were users id1 id2 id3 and then id3 id1 id2 ?
The point is that there are employees and halls, and the “drag and drop” method puts employees in the halls, but there can be several employees in the hall and their sequence is also important. Well, it would be nice to keep a history - what data was corrected.
Operating rooms: Date 03/04/2018
Hall-1
---1. Anesthesiologist Ivanov
---2. Anesthesiologist Petrov
Hall-2 ..........
Then they put Sidorov in first place in hall-1 and the rest should be second and third respectively

Answer the question

In order to leave comments, you need to log in

2 answer(s)
#
#, 2018-03-04
@mindtester

DB - SQL? or NoSql? ...
general advice - try to consider the sequence itself as a storage unit .. (something tells me that you will need to work with different "sequences")
if SQL with normalization is the "employees" table and the "id sets" table employees"?...
yes, in any case, all the curtsy around this scheme..
ps
and yes - the word "dragging" .. has nothing to do with the database.. it's a GUI... maybe... but why not? create, invent, try ..
pps
if you can do it (a set of tables):
1 - id, person
2 - id, situation // ,description
3 - id, order, id-person, id-situation
and do what you want ... can you?
oh yes.. with history:
3 - id, version, order, id-person, id-situation
made easier?

R
Roman Rakzin, 2018-03-04
@TwoRS

I see the structure approximately like this
id, Date, HallID, Employees (JSON)
{created_time: "03/04/2018 13:45",created_admin_id:1, sotrudniki:[1,5,432,2]},
{created_time:"03/04/2018 13: 44",created_admin_id:1, sotrudniki:[5,432,2]}
This is if the combined version of SQL AND NOSQL
It can be seen that at first there were 3 employees, and then employee id1 was added to the first place

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question