---
title: "Difference between Primary key and Foreign Key"  
description: "Difference between Primary key and Foreign Key"  
author: "Allen Scott"  
published: 2017-01-27  
updated: 2017-01-27  
canonical: https://www.mindstick.com/forum/34251/difference-between-primary-key-and-foreign-key  
category: "database"  
tags: ["sql"]  
reading_time: 1 minute  

---

# Difference between Primary key and Foreign Key

Hi GuysI am littlebit confuse about [primary key](https://www.mindstick.com/blog/214/primary-key) and [foreign key](https://www.mindstick.com/blog/174/foreign-key-self-reference-constraint) while i read [online](https://www.mindstick.com/articles/13083/benefits-of-students-who-can-get-online-assignment) related blogs and articles.I don't understand clear [difference](https://www.mindstick.com/articles/157114/good-news-or-bad-news-and-the-difference-is) between primary key and foreign key.Please clear me difference between primary key and foreign key\
Thanks\

## Replies

### Reply by Simond Gear

Here is a some Difference between [primary](https://www.mindstick.com/forum/33739/difference-between-primary-key-and-unique-key) key and [Foreign](https://yourviews.mindstick.com/story/2164/here-are-the-best-foreign-universities-for-higher-education) key

**Primary key-**

A table can have one primary key.

It cannot accept duplicate values.

It is default clustered index

It cannot accept null value

**Foreign Key-**

Default is Non_Clustered Index

A table can have more than one foreign key

It can accept duplicate value.

It accept null value.

It provide link between data in two table.


---

Original Source: https://www.mindstick.com/forum/34251/difference-between-primary-key-and-foreign-key

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
