Zero value in database

Null means

  • No value
  • Not applicable, not assigned, unknown or inaccessible

What is right?

+3
source share
12 answers

All about the context in which it was used. A null value means that there is no value, but the reason for this will depend on the domain in which it is used. In many cases, the elements you listed are valid null actions.

+3
source

This can mean any of these things (and it is not always obvious that), which is one of the arguments against using zeros in general.

See: http://en.wikipedia.org/wiki/Null_(SQL)#Controversy

+2
source

Null - , (SQL) , . , . . , SQL Null , () " ". (ω) Null . NULL SQL , Null .

+1

, , , . - ( - ), null (, , " " ). .

, null , . WTF.: -)

, , .

+1

null , , .

; true, false .

+1

, SQL, - "". " ",

'Hi there' = NULL

FALSE, NULL. , NULL , " ", .

+1

NULL , , NULL. .

, NULL '=' where, 'is', :

select * from User where username is NULL;

:

select * from User where username = NULL;
0

NULL, , . , , SQL.

0

Null , .

.

0

Null - , .

:

int ..., 0,1,2,3,... NULL.

datetime ... NULL.

0 1..., NULL.

varchar ... NULL.

. ?

NOT NULL , .

0

The NULL SQL keyword is used to represent either a missing value or a value that is not applicable in a relational table.

0
source

all :-) if you want to add semantic meaning to your field, add ENUM

create TABLE myTable
  (
  myfield varchar(50)
  myfieldType enum ('OK','NoValue','InApplicable','Unassigned','Unknown','Unavailable') NOT NULL
  )
0
source

Source: https://habr.com/ru/post/1710826/


All Articles