How to add a check key constraint on a table or column

 How to add a check key constraint on a table or column

ADD CHECK

 টেবিল তৈরীর পরে CHECK CONSTRAINT ADD করা ।

 

SQL> alter table pr_detail

add constraint chk_prtn_id check (pr_id between 1 and 100)

Table altered.

 

Not null constraint

Unique key constraint

Primary key constraint

Foreign key constraint

 

 

How to add a primary key constraint on table or column

 How to add a primary key constraint on table or column

 

ADD PRIMARY KEY

 টেবিল তৈরীর পরে PRIMARY KEY CONSTRAINT ADD করা ।

 

SQL> alter table product

add constraint PK_PRI_PRO_ID PRIMARY KEY(product_id);

 

Table altered.

 

Not null constraint

Unique key constraint


 

How to add foreign key constraint to a table or column

 How to add foreign key constraint to a table or column

ADD FOREIGN KEY

টেবিল তৈরীর পরে FOREIGN KEY CONSTRAINT ADD করা ।

SQL>alter table pr_detail

add constraint fk_prtn_id foreign key (pr_id) references pr_master(pr_id)

Table altered.

 

Not null constraint

Unique key constraint

Primary key constraint