Set a Column Value to NULL in MariaDB

The fundamental syntax to set a column value to NULL is as follows.

Syntax:

UPDATE table_name
SET column_name = NULL
WHERE condition;

Explanation:

  • table_name: Name of your table.
  • column_name: Name of the column you want to set null.
  • WHERE condition: Condition with any necessary criteria to identify the records you want to update.

How to Set a Column Value to NULL in MariaDB

In MariaDB, the NULL represents an unknown value in a column. Changing a column value to NULL is the most common operation performed in MariaDB that allows us to remove existing data in a specific field. It is applicable in different ways including data correction, record inclusions and values setting. In this article, we will look through the different methods with which we can set a column value to NULL in MariaDB.

Similar Reads

Set a Column Value to NULL in MariaDB

The fundamental syntax to set a column value to NULL is as follows....

Method to Set a Column Value to NULL in MariaDB

Method 1: Using UPDATE Statement...

Conclusion

In MariaDB the task of setting the value of a column to NULL is a simple process. It can be performed using either the UPDATE statement or the ALTER TABLE statement. According to your particular preferences, you can make selection the method that suits your needs. Irrespective of whether you’ll be updating existing entries or modifying table columns, MariaDB grants you the required tools to smoothly handle NULL values in your database....