> For the complete documentation index, see [llms.txt](https://docs.e6data.com/product-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.e6data.com/product-documentation/sql-command-reference/logical-operators.md).

# Logical Operators

#### \<expr1>  <mark style="color:purple;">AND</mark>  \<expr2>

Returns true if both the values evaluate to true.

```sql
> select colA from table1 where colB > x AND colB <> y;
```

#### \<expr1>  <mark style="color:purple;">OR</mark>  \<expr2>

Returns true if any of the values evaluate to true.

```sql
> select colA from table1 where colB > x OR colB = null;
```

#### <mark style="color:purple;">NOT</mark>  \<expr>

Returns true if the value is false.

```sql
> select colA from table1 where colB NOT y;
```

The following truth table demonstrates the boolean output of `AND` and `OR:`

| a     | b     | a AND b | a OR b |
| ----- | ----- | ------- | ------ |
| true  | true  | true    | true   |
| true  | false | false   | true   |
| false | true  | false   | true   |
| false | false | false   | false  |
