What is the SQL NOT NULL Constraint and how it can be used with the database?
The SQL NOT NULL Constraint does not allow null values on that column.
SQL NOT NULL Constraint Example:
Lets assume that you have a table 'customer'. You have name column on it. You want that all customers stored on this table must have a name. You can use NOT NULL constraint on this table to make sure that each customer's name is saved on this table.
Use following syntax of sql not null constraint at the time of creating table:
CREATE TABLE customer (
id INT NOT NULL,
name VARCHAR(50) NOT NULL,