> For the complete documentation index, see [llms.txt](https://ploegert.gitbook.io/til/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ploegert.gitbook.io/til/programmy/linux/is-app-installed/types-and-operators/is-it-null-or-not-null.md).

# Is It Null Or Not Null?

In PostgreSQL, the standard way to check if something is `NULL` is like so:

```sql
select * as wild_pokemons from pokemons where trainer_id is null;
```

To check if something is not null, you just add `not`:

```sql
select * as captured_pokemons from pokemons where trainer_id is not null;
```

PostgreSQL also comes with `ISNULL` and `NOTNULL` which are non-standard ways of doing the same as above:

```sql
select * as wild_pokemons from pokemons where trainer_id isnull;
```

```sql
select * as captured_pokemons from pokemons where trainer_id notnull;
```
