PRIMARY KEY Required ?
JOYDEEP DAS
JOYDEEP DAS
Project Manager at Cognizant | MVP - Data Platform | Azure Data Engineer Associates | Azure DataBricks | Azure DevOps
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