Unique key with NULLs

前端 未结 10 813
一整个雨季
一整个雨季 2020-12-03 00:48

This question requires some hypothetical background. Let\'s consider an employee table that has columns name, date_of_birth, tit

10条回答
  •  萌比男神i
    2020-12-03 01:13

    In simple words,the role of Unique constraint is to make the field or column. The null destroys this property as database treats null as unknown

    Inorder to avoid duplicates and allow null:

    Make unique key as Primary key

提交回复
热议问题