> For the complete documentation index, see [llms.txt](https://gyansetu-sql.gitbook.io/sql-programming/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gyansetu-sql.gitbook.io/sql-programming/sql-select/sql-null-functions.md).

# SQL ISNULL Functions

### SQL ISNULL()

Look at the following "Products" table:

![](https://826093633-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LS8lPNzCGPR5-DLbGXv%2F-LScEsBM_b-6qP2URXfh%2F-LScFA0jDpstu7EFW17_%2Fimage.png?alt=media\&token=a0b58534-ea51-40fb-9968-7cb6c558266c)

\
Suppose that the "UnitsOnOrder" column is optional, and may contain NULL values.

Look at the following SELECT statement:

```sql
SELECT ProductName, UnitPrice * (UnitsInStock + UnitsOnOrder)
FROM Products;
```

In the example above, if any of the "UnitsOnOrder" values are NULL, the result will be NULL.

### Example

The SQL Server [ISNULL()](https://www.w3schools.com/sql/func_sqlserver_isnull.asp) function lets you return an alternative value when an expression is NULL:<br>

```sql
SELECT ProductName, UnitPrice * (UnitsInStock + ISNULL(UnitsOnOrder, 0))
FROM Products
```
