codescracker


sql

SQL Not Null



« Previous Tutorial Next Tutorial »


SQL NOT NULL constraint just enforces a column to NOT accept NULL values, means always contain a value.

SQL NOT NULL Constraint Example

Here is an example of NOT NULL Constraint in SQL. The following SQL enforces the column "StudentID" not to accept NULL values

CREATE TABLE students
(
   StudentID   INT          NOT NULL,
   Name  CHAR (25) , 
   Address  CHAR (25) , 
   PRIMARY KEY (StudentID)
);

« Previous Tutorial Next Tutorial »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test