Two coulmns can not be null at the same time in sql
Suppose there a table called
Employee
ID number, name varchar(24 char), address varchar2(100 char),
alternateAddress(100 char), sex varchar2(10 char)
Now I want to put constraint such that both address and alternateAddress
cannot be null i.e possible cases are:
address is null and alternateAddress is not null
alternateAddress is null and address is not null
alternateAddress is not null and address is not null
But cannot happen that any record in Employee table inserted with
alternateAddress and address both null
No comments:
Post a Comment