What are the differences between Null, Zero and Blank in SQL?

后端 未结 4 1675
你的背包
你的背包 2020-12-22 14:14

Can someone please explain the differences between Null, Zero and Blank in SQL to me?

4条回答
  •  太阳男子
    2020-12-22 14:26

    Could you be more accurate about blank?

    For what I understand of your question: "Blank" is the lack of value. This is a human concept. In SQL, you need to fill the field with a value anyway. So that there is a value which means "no value has been set for this field". It is NULL. If Blank is "", then it is a string, an empty one. Zero: well, Zero is 0 ... It is a number.

    To sum up:

    NULL --> no value set

    Blank ("") --> empty string

    Zero --> Number equal to 0

    Please, try to be more accurate next time you post an answer on Stack!

    If I were you, I would check some resources about it, for example: https://www.tutorialspoint.com/sql/sql-null-values.htm

提交回复
热议问题