#20 MySQL Tutorial for Beginners | Difference between Primary Key and Foreign Key

Опубликовано: 01 Январь 1970
на канале: Md Fakhrul Alam Sajib
160
17

In this video we will learn the differences between Primary Key and Foreign Key.

1. Primary Key never accepts null values , whereas foreign key accepts multiple null values.

2. Only one primary key is allowed in a table , while more than one foreign key are allowed in a table.

3. Primary Key is a column or group of columns/fields/attributes that uniquely identifies data in the table , whereas foreign key is used to link two tables (table of Primary key and table of Foreign Key) together. It is a field in the table that is a primary key of another table.

4. Primary Key does not allow duplicate values ,while foreign key allows duplicate values .

5.The value of the primary key can't be removed from the parent table , while the value of foreign key can be removed from the child table.

6. There is no restriction in inserting the values into the table column/field/attribute , while inserting any value in the foreign key table, guarantee that the value is present into a column of a primary key.


👤Connect with me:
https://www.instagram.com/sajibfakhru...

👇 Full Course of MySQL Tutorial for Beginners 👇
   • MySQL Tutorial for Beginners [2024]  

👇 Java Programming Tutorials 👇
   • Java Programming Tutorials for Beginners [...  

👇How to download and install SQL Server 2019 Express Edition and SQL Server Management Studio 18.8👇
   • How to download and install SQL Server 201...  

👇 Circuit Simulation using PSpice 👇
   • Circuit Simulation using PSpice  

👇 Subscribe My Channel Now 👇
   / mdfakhrulalamsajib  

#Md_Fakhrul_Alam_Sajib
#difference_between_primary_Key_and_foreign_Key
#mysql_tutorial