There is no single Boolean storage class in the SQLite database, and the Booean value is stored in integers 0 (false) and 1 (true), and by the time I practice, a Boolean has three states, 0 (FALSE) 1 (true), and null, as shown in the following illustration,
After the following INSERT statement, the test can be inserted successfully. And, by
SELECT * from stu where flag = "Database"
Query to the line named A9.
Insert into Stu (Name,flag) VALUES (' A1 ', ' True '); --0
Insert into Stu (Name,flag) VALUES (' A2 ', ' ture '); --0
Insert into Stu (Name,flag) VALUES (' A3 ', 1); --1
Insert into Stu (Name,flag) VALUES (' A4 ', ' null '); --0
Insert into Stu (Name,flag) values (' A5 ', ' 1 '); --1
Insert into Stu (Name,flag) VALUES (' A6 ', null); --2
Insert into Stu (Name,flag) VALUES (' A7 ', ' 2 '); --1
Insert into Stu (Name,flag) VALUES (' A8 ', 15); --1
Insert into Stu (Name,flag) VALUES (' A9 ', "database"); --0
Exporting the database, you can find that the execution of the SQL statement is like this,
INSERT into [Stu] values (' A1 ', 0);
INSERT into [Stu] values (' A2 ', 0);
INSERT into [Stu] values (' A3 ', 1);
INSERT into [Stu] values (' A4 ', 0);
INSERT into [Stu] values (' A5 ', 1);
INSERT into [Stu] values (' A6 ', null);
INSERT into [Stu] values (' A7 ', 1);
INSERT into [Stu] values (' A8 ', 1);
INSERT into [Stu] values (' string ', 0);
INSERT into [Stu] values (' string2 ', 0);
Insert into Stu (Name,flag) VALUES (' A9 ', 0); --0
Thus, it is assumed that the SQLite is a Boolean type of data inserted by a character store, but when taken out, the inserted character data is converted to an int type for use.
Therefore, the following conclusions can be obtained:
--the character can be converted to an int type ture, the conversion fails to False (0), int, long double, and so on ture (1), the Boolean type complains, NULL is NULL
PS: has not yet in-depth understanding of it, is currently the conclusion of practical testing, pure speculation, if the people know, can be informed.