Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

why a primary key column needs again NOT NULL constraint (DOUBLE NOT NULL)

User_3YG1KMar 7 2022

Hi,
I have seen few examples in docs that creates tables having primary key column , but explicitly defined again with NOT NULL constraint. I don't understand why is this needed...
create table cars( c_id number not null,
c_name varchar2(30),
Constraint Pk_c_id Primary Key (c_id));
A primary key itself is combination of not null + unique. but some of docs examples again use explicit NOT NULL declaration fro a primary key column which becomes DOUBLE NOT NULL . Please help me on this .Thnks.

Comments
Post Details
Added on Mar 7 2022
7 comments
2,628 views