2
Well explained in below loop. Now as an example for "Employee" table.
Column "Employee Id" can be Primary (no null, no duplicate, use as Ref. in other tables),
Column "Employee Number" can be Unique (no null as every one should have an employee number, no duplicate),
Column "Passport Number" can also be another Unique (can be null as some may not have passport, no duplicate)
Accepted 3
Hello Priyanka, 1)Primary Key never allow and accept null values. Unique Key can have only one null values. 2)Table can have only one Primary Key. Table can have more than one Unique Key. 3)Primary Key is Clustered Index. Unique Key is non-Clustered Index. 4)Primary Key Data in Database Table is Physically organized in the sequence because of Clustered Index. Unique Key Data is not Physically organized in the sequence. 5)Primary Key can make foreign key in another table. Unique Key can not be foreign key in another table.
1
1) Primary key must have unique value, it never contain null value. Whereas unique key must have unique value, but it may have null value.
2) Primary key is used to identify a row or record in a table. Whereas unique key is assigned to the column, it prevents the duplicate values in column.
3) A table may have only one primary key but it may have more than one unique key.
0
The primary key is accepted as a unique or sole identifier for every record in the table. In the case of a primary key, we cannot save NULL values. In the case of a unique key, we can save a null value, however, only one NULL value is supported
0
Thank you Jaish Mathews with the help of example I clearly clear my doubts.