hi
i want know is it possibe for check constraints and default constraints in 1 table.because i want to insert a row in the table like my field is mark.and i am give check constrats to mark fileld to if mark is less than 0 and greather then 100.but i want to if the check constraints is failed then the need to insert default value which is given the defualt value of mark filed.
Is it possible for check and default constraints in 1 tabl
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


Manisha Gupta45 reputationPosted Jun 30, 2014, 11:20 PM EDT
you can try this for your question. its easy and simple.
-----creating a table
create table just
(
mark int default 50 not null
check((mark>0) and (mark<100))
);
---inserting a specific value
insert into just (mark)
values(20);
---viewing complete table entries
select * from just;