Saturday, 19 November 2011


The NOT NULL constraint enforces field is always contain a value. This means thats you can not insert a new record in this field.
Not NULL Constraint can only be applied at column level.
Principles of NULL value:
  • A NULL values is different from a blank or zero.
  • A NULL value can be inserted into the columns of any Data Type.

Rules:
Number Data Type Error Produce: Blank, Space,Special Character,NULL
Number Data Type Allow to Only: O or 1 to 9
Varchar2 Data Type Error Produce: Blank
Varchar2 Data Type Allow to: NULL, Space, Special Cheracter

SQL NOT NULL Constraint Example

Syntax:
CREATE TABLE Table_Name
(
Column_Name1 DataType(Size) NOT NULL,
Column_Name2 DataType(Size) NOT NULL,
......
);
Example Statement:
CREATE TABLE Student_Detail
(
S_No number(2) NOT NULL,
Name varchar(25) NOT NULL,
Address varchar(70),
City varchar(20)
);

0 comments:

Post a Comment

TrainingHUB. Powered by Blogger.

Total Pageviews

THE BEST QTP TRAINING INSTITUTE IN HYDERABAD

QTP Training in hyderabad

Sql Tutorial

Popular Posts

Our Facebook Page

TrainingHUB

Followers