A
A
Alexander2016-02-21 09:06:31
Database design
Alexander, 2016-02-21 09:06:31

What is the best structure for a database?

There are 5 tables.
T1 (fields id, name,...),
T2(id, id_t1, name, ...),
T3(id, id_t2, name, ...),
T4(id, id_t3, name, ...) ,
T5(id, id_t4, name, ...).

For each entry in T1, there are from 1 to 10-20 entries in T2 (1-to-many relationship)
For each entry in T2, there are from 1 to 10-20 entries in T3 (1-to-many relationship)
For each entry in T3, there are from 1 up to 10-20 records in T4 (1-to-many relationship)
For each record in T4, there are from 1 to 100-2000 records in T5 (1-to-many relationship)

There will be queries like find all T5 records that belong to T1 (T2, T3 or T4).
Does it make sense to store id_t1, id_t2, id_t3 in T5?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Voronkov, 2016-02-21
@CooperIII

Store data in third normal form, if there is a heavy load on the database, only then will it make sense to think about denormalization

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question