Sitemap
Elvan Tektaş

Elvan Tektaş

Full-Stack Developer - Computer Programming 👩‍💻 https://github.com/tektaselvan

SQL WHERE

Nov 11, 2023

--

The SQL WHERE Clause

The WHERE clause is used to filter records.

It is used to extract only those records that fulfill a specified condition.

Syntax

SELECT column1, column2, …
FROM table_name
WHERE condition;

Examples:

Press enter or click to view image in full size

Operators in The WHERE Clause

The following operators can be used in the WHERE clause:

= : Equal

Ex.

Press enter or click to view image in full size
Equal

> : Greater than

Ex.

Press enter or click to view image in full size
Greater-than

< : Less than

Get Elvan Tektaş’s stories in your inbox

Join Medium for free to get updates from this writer.

Ex.

Press enter or click to view image in full size
Less-than

<= : Less than or equal

Ex.

Press enter or click to view image in full size
Less-than-or-equal

>= : Greater than or equal

Ex.

Press enter or click to view image in full size

<> : Not equal. Note: In some versions of SQL this operator may be written as !=

Ex.

Press enter or click to view image in full size
Not-equal

BETWEEN : Between a certain range

Ex.

Press enter or click to view image in full size
Between

LIKE : Search for a pattern

Ex.

Press enter or click to view image in full size
Like

IN : specify multiple possible values for a column

Ex.

Press enter or click to view image in full size
In

--

--

Elvan Tektaş
Elvan Tektaş

Written by Elvan Tektaş

Full-Stack Developer - Computer Programming 👩‍💻 https://github.com/tektaselvan