Search notes:

SQLite: no boolean data type

SQLite does not have a boolean data type. However, it understands the keywords true and false which evaluate to 1 and 0, respectively.
create table country (
   name       text,
   in_europe  integer
);

insert into country values ('Panama ', false);
insert into country values ('Egypt'  , false);
insert into country values ('Sweden' , true );
insert into country values ('Japan'  , false);
insert into country values ('Spain'  , true );

.header on
.mode   column
.width  6 9
select * from country;
--
-- name    in_europe
-- ------  ---------
-- Panama  0        
-- Egypt   0        
-- Sweden  1        
-- Japan   0        
-- Spain   1        

select name from country where in_europe;
--
-- Sweden
-- Spain

select name from country where not in_europe;
--
-- Panama
-- Egypt
-- Japan
Github repository about-sqlite, path: /datatypes/true-false.sql

See also

The five SQLite data types.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758207105, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/SQLite/datatypes/boolean(74): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78