R
R
Roman Rakzin2017-02-20 21:29:46
SQL
Roman Rakzin, 2017-02-20 21:29:46

What is the best way to organize data structure in a database?

0
downvote
favorites The
following data should be saved with the patient's tests:

  1. datetime
  2. PatientId
  3. Erytr
  4. Tromb
  5. Leyk
  6. Hb ...... etc.

What is the best way to organize the table structure? where the fields will be, as indicated above, or like this ...?
one)
  1. Id (=AnalyzId)
  2. PatientId
  3. datetime

2)
  1. AnalizId
  2. ParameterId
  3. value

And how will this affect performance and what are the benefits of each type?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
totosarg, 2017-02-20
@totosarg

Can you describe in simple words what you need to store? As I understand it, you have a patient, and his data, and there are tests? Like erythrocytes, ROE, and all that? the question is what? how to store tests for patients? What do your tests look like? 1 record with all analyses, or each analysis has its own record? (how do you get the data, or will someone enter them)? How are they going to use this data? What fields do you want to search? The answer to your question depends on the answers to my questions :). And now, I advise you to read: https://en.wikipedia.org/wiki/Database_normalization

R
Rsa97, 2017-02-20
@Rsa97

The first option is suitable if the analysis is always with the same set of indicators. The second option, respectively, allows you to record analyzes with different sets of indicators. It is somewhat more difficult to write, but more flexible.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question