Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
SQL Like | Filtering Statements
SQL Tutorial for Beginners
course content

Зміст курсу

SQL Tutorial for Beginners

SQL Tutorial for Beginners

1. Database & Introduction to Syntax
2. SQL Aggregate Functions
3. Filtering Statements

SQL Like

The LIKE operator is used with WHERE to search for some pattern in a string.

The pattern is usually some kind of Regular Expression that is built with some rules, but we won't dive deep into it. In the meantime, the following rules are enough for you:

  • % means 0 or more symbols: a% matches a, aa, aaaaa, etc. b%d matches bd, bad, bored, etc.
  • _ matches single symbol. t_ee matches tree, twee etc, and _o%_ match wow, coooow, soap etc., but not so for example.

In this example all singers with the naming of two separate words, both consist of at least one symbol.

12
SELECT singer FROM songs WHERE singer LIKE '_% _%'
copy

Завдання

Select all singers with naming starting with A.

Завдання

Select all singers with naming starting with A.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 3. Розділ 2
toggle bottom row

SQL Like

The LIKE operator is used with WHERE to search for some pattern in a string.

The pattern is usually some kind of Regular Expression that is built with some rules, but we won't dive deep into it. In the meantime, the following rules are enough for you:

  • % means 0 or more symbols: a% matches a, aa, aaaaa, etc. b%d matches bd, bad, bored, etc.
  • _ matches single symbol. t_ee matches tree, twee etc, and _o%_ match wow, coooow, soap etc., but not so for example.

In this example all singers with the naming of two separate words, both consist of at least one symbol.

12
SELECT singer FROM songs WHERE singer LIKE '_% _%'
copy

Завдання

Select all singers with naming starting with A.

Завдання

Select all singers with naming starting with A.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 3. Розділ 2
toggle bottom row

SQL Like

The LIKE operator is used with WHERE to search for some pattern in a string.

The pattern is usually some kind of Regular Expression that is built with some rules, but we won't dive deep into it. In the meantime, the following rules are enough for you:

  • % means 0 or more symbols: a% matches a, aa, aaaaa, etc. b%d matches bd, bad, bored, etc.
  • _ matches single symbol. t_ee matches tree, twee etc, and _o%_ match wow, coooow, soap etc., but not so for example.

In this example all singers with the naming of two separate words, both consist of at least one symbol.

12
SELECT singer FROM songs WHERE singer LIKE '_% _%'
copy

Завдання

Select all singers with naming starting with A.

Завдання

Select all singers with naming starting with A.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

The LIKE operator is used with WHERE to search for some pattern in a string.

The pattern is usually some kind of Regular Expression that is built with some rules, but we won't dive deep into it. In the meantime, the following rules are enough for you:

  • % means 0 or more symbols: a% matches a, aa, aaaaa, etc. b%d matches bd, bad, bored, etc.
  • _ matches single symbol. t_ee matches tree, twee etc, and _o%_ match wow, coooow, soap etc., but not so for example.

In this example all singers with the naming of two separate words, both consist of at least one symbol.

12
SELECT singer FROM songs WHERE singer LIKE '_% _%'
copy

Завдання

Select all singers with naming starting with A.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 3. Розділ 2
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt