NOT NULL


If no value is given in each column of the table of SQL, then by default is 'NULL' (no value). If you do want NULL set, then it is necessary to give a constraints for that column.

Example : Let's see, how to create NOT NULL Constraints. we create a table called my_tb and Id set the NOT NULL constraint.

Query : 

CREATE TABLE my_tab

(

Id int(10) NOT NULL,

Name varchar(30),

Address varchar(50)

);

Output :


Use DESC Command, Now you can see 'Id' contain NOT NULL value.

Query :
DESC my_tb;