Usin Check Constraints in sql

Posted by Ij under Oracle category on | Points: 40 | Views : 261
this constraints used to define logical conditions according to our bussiness,
Check constraint allows to specify a condition on each row in a table

create table s1(sname varchar2(10),sid number,sgender varchar2(10),sarea varchar2(10),
chek(sgender in('m','f')),
constraint SID-PRI-KEY primary key(sid));

In oracle all constraint information store under USER_CONSTRAINT'
select * from user_constraints where tabale_name='s1';

if we want to view columns names along with constraint name then we are using 'USER_CONS_COLUMNS'
select * from user_cons_columns where table name='s1';

Comments or Responses

Login to post response