Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between primary, unique and foreign key constraints, and indexes? [closed]

What is the difference between primary, unique and foreign key constraints, and indexes?

I work on Oracle 10g and SQL Server 2008.

like image 823
Gold Avatar asked Sep 11 '25 16:09

Gold


1 Answers

Primary Key: identify uniquely every row it can not be null. it can not be a duplicate.

Foreign Key: create relationship between two tables. can be null. can be a duplicate  

like image 169
sana Avatar answered Sep 14 '25 05:09

sana