2 2 votes select true statements: foreign key may be null. primary key may be null. none Databases + – gate_forum 1.1k views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
Best answer 4 4 votes Foreign key may be NULL but can not have mismatched value from its corresponding primary/unique key Ref Integrity Primary key can not have NULL or duplicate value Entity Integrity hence first statement is true Sanjay Sharma answered Jul 5, 2016 • selected Sep 27, 2016 by vijaycs Sanjay Sharma comment Share Follow See all 3 Comments 3 3 Comments reply Sushant Gokhale commented Sep 27, 2016 reply Follow flag How foreign key can be null? It refers the values that forms the primary key for one table. Now, can NULL be one of the values for the primary key in this referenced table? 0 0 replyShare Habibkhan commented Sep 27, 2016 reply Follow flag If you do ON DELETE SET NULL for foreign key then on deletion of a primary key value then corresponding foreign key value will be set to NULL.Hence only 1st statement is true But primary key is never NULL and unique. 0 0 replyShare Sanjay Sharma commented Sep 27, 2016 reply Follow flag it is quite possible and natural for a foreign key to be Null e.g bank a/c no. is P.K in some table like Bank and bank a/c no. is F.K. in some other table like student derving its value from Bank table now a student may or may not have a bank a/c if it have then it must be defined in bank table it not then it is NULL 0 0 replyShare Please log in or register to add a comment.
1 1 vote Primary key can't be Null in any case otherwise there would not be any use of it.But foreign key can be Null. And it refers to the primary key in the first table. shekhar chauhan answered Jul 5, 2016 shekhar chauhan comment Share Follow 0 reply Please log in or register to add a comment.