SQL Server Predicate

  • Hi,

    I need to get clear idea abut SQL Server Predicates,

    according to Microsoft document it describes there are only 4 predicates available in sql server.

    https://learn.microsoft.com/en-us/sql/t-sql/queries/predicates?view=sql-server-ver16

    CONTAINS

    FREETEXT

    IS [NOT] DISTINCT FROM

    IS [NOT] NULL

    but my drought is, why below expression are not categorize as Predicates because all of the below expression that evaluate to TRUE, FALSE, or UNKNOWN

    BETWEEN,EXISTS,IN,LIKE,<,>,=,.....etc.

    Can any one explain my drought clearly?

  • The expressions you mentioned, such as BETWEEN, EXISTS, IN, LIKE, <, >, =, and others, are often referred to as operators or comparison operators rather than predicates.

    In logic, predicates typically involve statements or propositions that can be evaluated as true or false. Predicates are used to make assertions or describe properties about objects or variables. For example, "x is greater than 5" or "y is a prime number" are predicates because they make a claim about the properties of x and y, respectively.

    On the other hand, operators like < (less than), > (greater than), = (equals), BETWEEN, IN, and LIKE are used to compare values, perform mathematical operations, or perform set operations. These operators are used to evaluate conditions or perform actions based on comparisons. While they can return a Boolean value (true, false) based on the comparison, they do not make direct statements or propositions like predicates do.

  • @jonathan-2 AC Roberts, Thanks for the clear explanation.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply