I would like to thank you for your comment especially Cheryl Marsh .
I did not mean to show off myself,I just wanted to share my Idea with you.
If you have seen my previous article,you may find that the idea behind this procedure code is self-explanatory.
I knew that there is a 3rd value for bit that is UNKNOWN,but there are only 2 values
in propositional logic :true and false ,not more,so I did not need to deal with UNKNOWN
consider the following table:
create table #stu(
sex char(1) check( sex in( 'm','f')),
we are asked to make a report that show all the students with
if the student has a score='a' then sex must be 'f' .
if the student has a score='b' then courseTaken must be greater than 7.
so the question implicitly says that the other students that do not meet aforementioned
condition should be in result set
since there is no Implies operator in SQL you need to use the following formula
p IMP Q==~P | Q
if you call
where (grade<>'a' or sex='f')
and (grade<>'b' or courseTaken>7)
drop table #stu
I do agree this is not a clear example, but I have used it more often than not ;hope it gives you some idea
when implies operator will come in handy.