NOT NULL Keyword
The NOT NULL keyword or constraint is used to ensure that no null values are allowed in a column.
If NOT NULL constraints are applied to that column, you cannot insert or update it without adding value.
SQL NOT NULL ON CREATE TABLE
SQL
CREATE TABLE <TABLE_NAME>(
<COLUMN_NAME> <DATATYPE> NOT NULL
);Example
SQL
CREATE TABLE Employee(
Emp_Id Integer Primary Key,
Emp_Name Varchar(50) NOT NULL,
Emp_Salary Integer NOT NULL,
);SQL NOT NULL ON ALTER TABLE
SQL
ALTER TABLE <TABLE_NAME>
MODIFY <COLUMN_NAME> <DATATYPE> NOT NULL;Example
SQL
ALTER TABLE Employee
MODIFY Emp_Dept Varchar(50) NOT NULL;Summary
The NOT NULL keyword or constraint is used to prevent users from adding null values to the column.

Join the conversation! Your thoughts help the community grow.