SQL Keywords

SQL FALSE

What is SQL FALSE?

FALSE is the Boolean literal that represents the logical value of false in SQL expressions.
Sign up to get up to date news on SQL keywords
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Compatible dialects for SQL FALSE: Supports: PostgreSQL, MySQL 8.0+, MariaDB 10.2+, SQLite 3 (as numeric 0), Oracle 23c, Snowflake, BigQuery, DuckDB. Not supported natively: SQL Server (use BIT 0).

SQL FALSE Full Explanation

FALSE is a reserved Boolean literal defined by the SQL standard. When a database supports the BOOLEAN data type, the literal evaluates to the numeric value 0 or an internal false flag, depending on implementation. FALSE can appear anywhere an expression is allowed: in SELECT lists, predicates, CASE expressions, CHECK constraints, and default values.Evaluation rules:- Comparisons that resolve to FALSE eliminate rows in WHERE, HAVING, and JOIN ON clauses.- In three-valued logic (TRUE, FALSE, UNKNOWN), FALSE is distinct from NULL/UNKNOWN. A predicate evaluating to UNKNOWN (e.g., column IS NULL) is not considered FALSE.Casting and storage:- In PostgreSQL and MySQL, BOOLEAN columns store FALSE as 0.- SQLite treats FALSE as the integer 0 in numeric affinity columns.Caveats:- SQL Server does not recognize the literal FALSE; use 0 or the BIT data type instead.- Earlier Oracle versions lacked BOOLEAN in SQL (PL/SQL only). Oracle 23c introduces BOOLEAN support with FALSE.- Do not quote the literal ('FALSE'); that turns it into a string, not a Boolean.

SQL FALSE Syntax

-- As a standalone literal
FALSE

-- In a predicate
WHERE is_active = FALSE

-- As a default value
CREATE TABLE plans (
  id INT PRIMARY KEY,
  is_archived BOOLEAN DEFAULT FALSE
);

SQL FALSE Parameters

Example Queries Using SQL FALSE

-- 1. Return a constant false value
SELECT FALSE AS is_valid;

-- 2. Filter out deleted users
SELECT id, username
FROM users
WHERE is_deleted = FALSE;

-- 3. Use in a CASE expression
SELECT order_id,
       CASE delivered
            WHEN TRUE  THEN 'Delivered'
            WHEN FALSE THEN 'Pending'
       END AS status
FROM orders;

-- 4. Add a check constraint that a price discount flag is never FALSE when percentage > 0
ALTER TABLE products
ADD CONSTRAINT chk_discount_positive
CHECK (NOT (has_discount = FALSE AND discount_pct > 0));

Expected Output Using SQL FALSE

  • Returns a single row with the column is_valid containing FALSE.
  • Returns only rows where is_deleted is FALSE.
  • Converts TRUE/FALSE to human-readable text.
  • Prevents inserts or updates that violate the check constraint.

Use Cases with SQL FALSE

  • Store Boolean attributes such as is_active, is_deleted, or has_access.
  • Write clear predicates without magic numbers (0 or 1).
  • Supply default values when creating tables.
  • Build business rules inside CHECK constraints or CASE expressions.

Common Mistakes with SQL FALSE

  • Using string 'FALSE' instead of the unquoted literal, causing implicit casts or errors.
  • Expecting FALSE to be equivalent to NULL; UNKNOWN (NULL) is not FALSE.
  • Attempting to use FALSE in SQL Server, which lacks native support.
  • Comparing numeric columns directly to FALSE (e.g., price = FALSE) leading to type errors.

Related Topics

SQL TRUE, SQL UNKNOWN, BOOLEAN data type, CASE expression, IS NULL predicate, BIT type (SQL Server)

First Introduced In

SQL:1999 (BOOLEAN data type)

Frequently Asked Questions

What does FALSE return when selected?

Selecting FALSE returns a single Boolean value representing logical false. In most client libraries it appears as 0 or the word "false".

Can I compare integers to FALSE?

Only if the database implicitly casts. Best practice is to compare Boolean columns to FALSE, not integers.

How do I invert FALSE?

Use the NOT operator: NOT FALSE evaluates to TRUE.

Why does SQL Server reject FALSE?

SQL Server uses the BIT type for Booleans and accepts 0 or 1 instead of the literals FALSE and TRUE.

Sign up to get up to date news on SQL keywords
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.
Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo

Check out other commonly used SQL Keywords!