A
A
AE422020-12-03 08:11:07
PostgreSQL
AE42, 2020-12-03 08:11:07

How to create the right database architecture?

Hello.

I have a main games table - where all the games are located. There is a condition_id column in the table - the id of the game conditions
In the condition_games table - all the conditions are located

Suppose I have a column trace in condition_games:
| id | mode | isSubscribe | minBet | .... |
In total, I have about 10 conditions for the game, some columns can take a null value, that is, this condition is not included in the game

. be generally 1 condition out of 10?
For example, divide into several groups and package according to other tables (but then it is not convenient to take the necessary data)?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Tsvetkov, 2020-12-03
@yellow79

A binary format suggests itself for your ten conditions. Zeros instead of NULLs Checking if conditions match with binary AND. That is, you will not have 10 Boolean fields, but one

D
Dmitry S, 2016-11-17
@verdex

WHERE after SET

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question