B
B
beduin012020-10-27 15:04:22
PostgreSQL
beduin01, 2020-10-27 15:04:22

Join by null or is there something better?

An example to make the problem clear. There is a table:
house number | housing

The problem is that some houses do not have a housing. And I don't know how to be. I don’t like leaving NULL, writing 1 is also not correct, like 0. It could be left like that, but the problem is that I will need to join to another table according to the corpus.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Tsvetkov, 2020-10-27
@tsklab

Use a surrogate key to connect.
The number of the house and building cannot be numbers, as they can contain letters. Lack of value is always NULL.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question