Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Using the NOT Operator | Section
SQL Fundamentals
Sectie 1. Hoofdstuk 30
single

single

bookUsing the NOT Operator

Veeg om het menu te tonen

In order to cancel the condition, you need to use the keyword NOT.

The NOT operator is essential when you want to exclude certain records from your query results. It allows you to specify conditions that should not be met, effectively filtering out unwanted data. This can be particularly useful in scenarios where you need to focus on a subset of data that does not meet specific criteria.

First, let's look at the syntax:

SELECT columns
FROM table 
WHERE NOT condition;

Now let's look at the example:

123
SELECT name, capital FROM country WHERE NOT continent='Asia';
copy

The NOT operator rejects the condition here; hence, it matches the continent to anything that is not Asia.

Taak

Swipe to start coding

Write an SQL query to get the name and capital columns from the country table (please retrieve these columns in this order). These countries must be not from the 'South America' continent.

Note

Pay attention to the fact that the names of the continents begin with a capital letter and not a lowercase one; this is very important.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 30
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

some-alt