PRIMARY KEY Required ?

PRIMARY KEY Required ?

Introduction
As we all know that the PRIMARY key is the combination of UNIQUE and NOT NULL. 

We got a funny example that we want to share it with you.

Example
Trying to create a table in this manner

CREATE TABLE temp_Table
(
   EmpID          INT         PRIMARY KEY,
   EmpName   VARCHAR(50) NOT NUL
);

Look here with EmpID I am not mentioned any NOT NULL constraint. So the question is the Primary Key is created or NOT

The answer is YES

Learn More....

要查看或添加评论,请登录

社区洞察