Complete the code to select all rows where the boolean column is true.
SELECT * FROM users WHERE active = [1];In PostgreSQL, the boolean literal TRUE is used without quotes to represent true values.
Complete the code to insert a false boolean value into the column.
INSERT INTO settings (enabled) VALUES ([1]);Use the boolean literal FALSE without quotes to insert a false value in PostgreSQL.
Fix the error in the WHERE clause to correctly filter rows where the boolean column is not true.
SELECT * FROM tasks WHERE completed [1] TRUE;In SQL, the standard operator for 'not equal' is <>.
Fill both blanks to create a query that selects rows where the boolean column is true or null.
SELECT * FROM orders WHERE status = [1] OR status IS [2];
To check for true or null values, use TRUE and IS NULL respectively.
Fill all three blanks to create a query that counts rows where the boolean column is false and not null.
SELECT COUNT(*) FROM logs WHERE flag = [1] AND flag IS NOT [2] AND flag IS NOT [3];
We count rows where flag is FALSE and not NULL, using IS NOT NULL conditions.