bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL IN Keyword

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind SQL IN Keyword?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

___ * FROM Customers
3Order

Put the learning moves in the order that makes the concept easiest to apply.

The following SQL uses the IN operator to select all customers from Germany, France, or UK:
The IN operator functions as a shorthand for multiple OR conditions, making queries shorter and more readable.
The IN operator is used in the WHERE clause to check if a specified column's value matches any value within a provided list.

In

The IN operator is used in the WHERE clause to check if a specified column's value matches any value within a provided list.

The IN operator functions as a shorthand for multiple OR conditions, making queries shorter and more readable.

The following SQL uses the IN operator to select all customers from Germany, France, or UK:

Example

SELECT * FROM Customers

 WHERE Country IN ('Germany', 'France', 'UK');

The following SQL selects all customers that are NOT located in "Germany", "France" or "UK":

Example

SELECT * FROM Customers

 WHERE Country NOT IN ('Germany', 'France', 'UK');

The following SQL selects all customers that are from the same countries as the suppliers:

Example

SELECT * FROM Customers

 WHERE Country IN (SELECT Country FROM Suppliers);

Previous

SQL HAVING Keyword

Next

SQL INDEX Keyword