SQLite’s NULL Is an item used to represent a missing value. One of the tables
NULL
A value is a value that appears blank in the field.
With Use when creating a table NULL The basic syntax is as follows: Here, NOT NULL Indicates that the column always accepts an explicit value of a given data type. There are two columns that we do not use NOT NULL, which means that they can be With The NULL value can cause problems when selecting data, because when comparing an unknown value with another, the result is always unknown and is not included in the final result. Suppose you have the following table, and the record for COMPANY is as follows: Let’s use Now, the record of the Next, let’s take a look. IS NOT NULL Operator that is used to list all Above. The following is IS NULL Operator, all of which are listed Above.
NULL
A field with a value is a field without a value. It is important to understand that the
NULL
value is different from a zero value or a field that contains spaces. 1.31.1. Grammar ¶
SQLite> CREATE TABLE COMPANY(
ID INT PRIMARY KEY NOT NULL,
NAME TEXT NOT NULL,
AGE INT NOT NULL,
ADDRESS CHAR(50),
SALARY REAL
);
NULL
.
NULL
The field of the value can be left blank when the record is created. 1.31.2. Example ¶
ID NAME AGE ADDRESS SALARY
---------- ---------- ---------- ---------- ----------
1 Paul 32 California 20000.0
2 Allen 25 Texas 15000.0
3 Teddy 23 Norway 20000.0
4 Mark 25 Rich-Mond 65000.0
5 David 27 Texas 85000.0
6 Kim 22 South-Hall 45000.0
7 James 24 Houston 10000.0
UPDATE
Statement to set some values that allow null values to be
NULL
, as follows:sqlite> UPDATE COMPANY SET ADDRESS = NULL, SALARY = NULL where ID IN(6,7);
COMPANY
table is as follows:ID NAME AGE ADDRESS SALARY
---------- ---------- ---------- ---------- ----------
1 Paul 32 California 20000.0
2 Allen 25 Texas 15000.0
3 Teddy 23 Norway 20000.0
4 Mark 25 Rich-Mond 65000.0
5 David 27 Texas 85000.0
6 Kim 22
7 James 24
SALARY
Not for
NULL
Record of:sqlite> SELECT ID, NAME, AGE, ADDRESS, SALARY
FROM COMPANY
WHERE SALARY IS NOT NULL;
SQLite
Statement will produce the following result:ID NAME AGE ADDRESS SALARY
---------- ---------- ---------- ---------- ----------
1 Paul 32 California 20000.0
2 Allen 25 Texas 15000.0
3 Teddy 23 Norway 20000.0
4 Mark 25 Rich-Mond 65000.0
5 David 27 Texas 85000.0
SALARY
For
NULL
Record of:sqlite> SELECT ID, NAME, AGE, ADDRESS, SALARY
FROM COMPANY
WHERE SALARY IS NULL;
SQLite
Statement will produce the following result:ID NAME AGE ADDRESS SALARY
---------- ---------- ---------- ---------- ----------
6 Kim 22
7 James 24