2 votes 2 votes The Given Answer is C) , my doubt is can PassportNo take NULL values as it is defined as UNIQUE ? Databases databases sql + – Harsh181996 asked Jan 17, 2017 retagged Aug 5, 2017 by Arjun Harsh181996 638 views answer comment Share Follow See all 5 Comments See all 5 5 Comments reply Show 2 previous comments Harsh181996 commented Jan 17, 2017 reply Follow Share So in the above question we are basically changing the entire coloum of Passport No. to 'AB9999' , which will create duplicate values and contradict the defination of PassportNo. right ? 0 votes 0 votes Pavan Kumar Munnam commented Jan 17, 2017 reply Follow Share yes, right 0 votes 0 votes ayush.5 commented Sep 19, 2020 reply Follow Share Why option A will work:- Null value is treated as unkown. The comparision of a null value with any other value(either null or not-null) is treated as unkown. So there can be many null values because when checked for “null==null” they don’t return true. 1 votes 1 votes Please log in or register to add a comment.
Best answer 4 votes 4 votes Yes it can take Null values. Bcoz constraint is unique, and Null is never equal to Null.If the constraint is specified as not Null then it cannot take but for unique it can take Null value for all rows. Rahul Jain25 answered Jan 17, 2017 selected Jan 19, 2017 by Rahul Jain25 Rahul Jain25 comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes Unique Key can have null values but primary key can not Sayan Bose answered Jun 2, 2017 Sayan Bose comment Share Follow See all 0 reply Please log in or register to add a comment.