The IF function in MariaDB is used to perform conditional operations. It returns different values based on the different conditions.
Syntax:
```
IF(condition, value_if_true, value_if_false)
```
You have to pass three arguments:
1. condition: The condition to be evaluated.
2. value_if_true: The value to return when the condition is true.
3. value_if_false: The value to return when the condition is false.
Here is an example:
```
SELECT product_name,
IF(stock > 0, ‘Available’, ‘Out of Stock’) AS stock_status
FROM products;
```
This will return a column named ‘stock\_status’ with the value ‘Available’ if the stock for a product is greater than 0, and ‘Out of Stock’ if it is not.