> For the complete documentation index, see [llms.txt](https://gyansetu-sql.gitbook.io/sql-programming/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gyansetu-sql.gitbook.io/sql-programming/sql-select/sql-exists-operator.md).

# SQL EXISTS Operator

### The SQL EXISTS Operator

The EXISTS operator is used to test for the existence of any record in a subquery.

The EXISTS operator returns true if the subquery returns one or more records.

#### EXISTS Syntax

```sql
SELECT column_name(s)
FROM table_name
WHERE EXISTS
(SELECT column_name FROM table_name WHERE condition);
```

### Demo Database

Below is a selection from the "Products" table :<br>

![](/files/-LSc7WufR5dOEcrlWEgG)

And a selection from the "Suppliers" table:

![](/files/-LSc7cCztcgTYobEhvMO)

**SQL EXISTS Examples**

The following SQL statement returns TRUE and lists the suppliers with a product price less than 20:

```
SELECT SupplierName
FROM Suppliers
```

&#x20;The following SQL statement returns TRUE and lists the suppliers with a product price equal to 22:

```
SELECT SupplierName
FROM Suppliers
```
