NEW
A boolean condition that evaluates to true or false, used to filter or select data in queries and rules.
DESCRIPTION
Predicates specify conditions in query languages and rules engines that determine which records or events are selected. In SQL, predicates appear in WHERE, JOIN, and HAVING clauses. They can combine comparisons, logical operators, and functions. Efficient predicate design improves performance with indexes and partitions. Predicates underpin selection in relational algebra and filtering in data pipelines. They also drive validation in data quality rules.
ALTERNATIVE DEFINITIONS
Wikipedia
In mathematics, a predicate is commonly understood to be a boolean-valued function P:X→{true,false}, called a propositional function, to be distinguished from relations.
Positions predicate as a boolean-valued function in mathematics.
Oracle
A condition specifies a combination of one or more predicates that can evaluate to TRUE, FALSE, or UNKNOWN.
Clarifies SQL usage and three-valued logic evaluation.
RELATED TERMS
WHERE Clause Filter Condition Relational Algebra Filtering Projection Index Query Optimization SQL
COMPETING TERMS
Boolean Expression
KNOWLEDGE AREAS
Data Engineering Data Storage & Operations Programming Languages Software Engineering
TARGET AUDIENCE
Data Engineer Software Developer BI Specialist Data Analyst Solution Architect
EXTERNAL SOURCES
- Wikipedia - Predicate (mathematical logic)
- Oracle - SQL conditions and predicates
- PostgreSQL - Boolean operators/functions
TOP QUESTIONS
What is a Predicate in databases?
It’s a boolean condition used in WHERE, JOIN, and HAVING clauses to filter rows.
Category: Definition
How do Predicates impact query performance?
Well-designed predicates enable index usage, partition pruning, and efficient execution plans.
Category: Requirements
What is three-valued logic in SQL Predicates?
Predicates can evaluate to TRUE, FALSE, or UNKNOWN, where NULLs often yield UNKNOWN.
Category: Misunderstanding
How should I write SARGable Predicates?
Avoid functions on indexed columns and use direct comparisons to allow index seeks.
Category: Best practices
What are common mistakes with Predicates?
Inconsistent NULL handling and non-SARGable expressions that block index usage.
Category: Mistakes
How do Predicates relate to data quality rules?
They define validation conditions used to flag invalid records or enforce constraints.
Category: Example
Can Predicates be combined?
Yes, using AND, OR, and NOT to express complex filtering logic.
Category: Overview
What’s the difference between a Predicate and a Condition?
A condition may combine multiple predicates; a predicate is a single boolean expression.
Category: Misunderstanding
Do Predicates exist outside SQL?
Yes; they appear in rules engines, programming languages, and logical inference systems.
Category: Overview