What is the best way to leave empty database cells?

I do not understand databases. If I have a database table containing many empty cells, what is the best way to leave them (for example, so that performance does not get worse, memory is not consumed, even if it is possible)?

I know that there is a "null" value. Is there a “no” meaning or equivalent that does not have flaws? Or simply without filling out the cell, it was considered empty, so there was nothing left to do? Sorry if this is a stupid question. Sometimes you don’t know what you don’t know ...

Do not try to discuss database normalization. Just wondering what common wisdom is for empty / empty / non-elements.

thank

+3
source share
5 answers

null . , null SQL.

CJ Date SQL , , , , , .

null. . , MySQL, Oracle, Microsoft SQL Server .

MySQL InnoDB, , , . -. , , .
+3

NULL. .

+3

. , (aka NULL), . , NULL - , .

- , , , . , , (, varchar, nvarchar), .

, , , , .

+1

, :

  • ? not null?

  • , , ?

, . , .

0

. , null, - .

-, NULL , , "" null. varchar , , . , , .

Personally, I prefer to use null values ​​with some reasonable movement of data to child tables if the data is really another entity (and often these fields turn out to need a one-to-many parent-child relationship, for example, when you may or may not know the number a person’s phone, put it in a separate telephone table, and then you often find that you need to store several phone numbers).

0
source

All Articles