Collection
zero Useful+1
zero

Null value

Terminology in the field of computer technology
In the database, a null value indicates that the value is unknown. A null value is different from a blank or zero value. There are no two equal null values. Comparing two null values or comparing null values with any other value returns unknown because each null value is unknown
Chinese name
Null value
Foreign name
the idle value
Features
No two equal null values
Discipline
computer science

Basic concepts

Announce
edit
A null value generally indicates that the data is unknown, not applicable, or will be added later. For example, the customer's middle initial may not be known when the customer places an order.

Use of null values

Announce
edit
To test for null values in a query, use IS NULL or IS NOT NULL in the WHERE clause.
When viewing query results in the SQL Server Management Studio code editor, null values are displayed as NULL
You can insert a null value in a column by explicitly declaring NULL in an INSERT or UPDATE statement, or by preventing the column from appearing in an INSERT statement, or by using an ALTER TABLE statement to add a new column to an existing table.
Null values cannot be used for information (such as primary keys) that is needed to distinguish one row from another in a table.
In program code, null values can be checked to perform certain calculations on rows with valid (or non null) data. For example, the report can only print social security columns whose data is not empty. It is important to delete null values when performing calculations, because some calculations (such as average values) will be inaccurate if null columns are included.
If there may be null values stored in the data and you do not want null values to appear in the data, you should create a query and Data modification Statement to delete null values or convert them to other values.

Operation of null value

Announce
edit
1. A null value is added, subtracted, multiplied and divided with other values, and the result is still null.
2. Count count function, which does not count null values.
3. Sum, avg, max, min and other aggregate functions will automatically ignore null values for calculation.