Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
NOT like this! | Filtering
SQL Basics
course content

Зміст курсу

SQL Basics

SQL Basics

1. Selecting
2. Filtering
3. Aggregating
4. Sorting
5. Grouping
6. Practicing

bookNOT like this!

Often situation when we know what we don't want to find. In the case of numeric value, you should already know, that there is <> sign in SQL which means not equal. This also works for non-numeric columns: you can easily set <> 'some word' condition. But what if we want to avoid multiple non-numeric values? Or avoid some pattern?

Of course, it's already solved! There is NOT statement in SQL, which can be used with LIKE and IN statements. For example, we can filter cars in audi_table so there won't be Q-series cars.

123
SELECT * FROM audi_cars WHERE model NOT LIKE 'Q%'
copy

Please note, that NOT should be placed before IN or LIKE, like in spelling.

Завдання
test

Swipe to show code editor

Extract all the cars from the audi_cars table except A3, A4, and Q3 models.

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

Як ми можемо покращити це?

Дякуємо за ваш відгук!

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

bookNOT like this!

Often situation when we know what we don't want to find. In the case of numeric value, you should already know, that there is <> sign in SQL which means not equal. This also works for non-numeric columns: you can easily set <> 'some word' condition. But what if we want to avoid multiple non-numeric values? Or avoid some pattern?

Of course, it's already solved! There is NOT statement in SQL, which can be used with LIKE and IN statements. For example, we can filter cars in audi_table so there won't be Q-series cars.

123
SELECT * FROM audi_cars WHERE model NOT LIKE 'Q%'
copy

Please note, that NOT should be placed before IN or LIKE, like in spelling.

Завдання
test

Swipe to show code editor

Extract all the cars from the audi_cars table except A3, A4, and Q3 models.

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

Як ми можемо покращити це?

Дякуємо за ваш відгук!

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

bookNOT like this!

Often situation when we know what we don't want to find. In the case of numeric value, you should already know, that there is <> sign in SQL which means not equal. This also works for non-numeric columns: you can easily set <> 'some word' condition. But what if we want to avoid multiple non-numeric values? Or avoid some pattern?

Of course, it's already solved! There is NOT statement in SQL, which can be used with LIKE and IN statements. For example, we can filter cars in audi_table so there won't be Q-series cars.

123
SELECT * FROM audi_cars WHERE model NOT LIKE 'Q%'
copy

Please note, that NOT should be placed before IN or LIKE, like in spelling.

Завдання
test

Swipe to show code editor

Extract all the cars from the audi_cars table except A3, A4, and Q3 models.

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

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Often situation when we know what we don't want to find. In the case of numeric value, you should already know, that there is <> sign in SQL which means not equal. This also works for non-numeric columns: you can easily set <> 'some word' condition. But what if we want to avoid multiple non-numeric values? Or avoid some pattern?

Of course, it's already solved! There is NOT statement in SQL, which can be used with LIKE and IN statements. For example, we can filter cars in audi_table so there won't be Q-series cars.

123
SELECT * FROM audi_cars WHERE model NOT LIKE 'Q%'
copy

Please note, that NOT should be placed before IN or LIKE, like in spelling.

Завдання
test

Swipe to show code editor

Extract all the cars from the audi_cars table except A3, A4, and Q3 models.

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