Difference between Primary Key & Foreign key in MySQL || MySQL Tutorial|| Code With Neha

preview_player
Показать описание
In one of my previous video we have discussed about primary key constraints and foreign key constraint
Today we will spot the difference between them and also will practically learn how to create table and link them with the help of primary and foreign key

So without any further delay let's get started

Difference Between Primary Key and Foreign Key

PRIMARY KEYFOREIGN KEYA primary key is used to ensure data in the specific column is unique.A foreign key is a column or group of columns in a relational database table that provides a link between data in two tables.

It uniquely identifies a record in the relational database table whereas foreign key refers to the field in a table which is the primary key of another table.

Only one primary key is allowed in a table.Whereas more than one foreign key is allowed in a table.

It is a combination of UNIQUE and Not Null constraints.It can contain duplicate values and a table in a relational database.

It does not allow NULL values .It can also contain NULL values.

Its value cannot be deleted from the parent table.Its value can be deleted from the child table.

It constraint can be implicitly defined on the temporary tables.It constraint cannot be defined on the local or global

that's all for today Hope you all will get some help from this video
If it's so then don't forget to subscribe my channel Code with Neha and press the Bell Icon for Regular Updates
See you in the next video till then Stay Safe Stay Happy

#differencebetweenprimarykeyandforeignkey
#differencebetweenprimarykeyandforeignkeyinmysql
#differencebetweenprimarykeyandforeignkeyinsql
#primarykeyvsforeignkey
#primarykeyvsforeignkeyinMySQL
#primarykeyvsforeignkeyinSQL
#Primaryandforeignkeyconstraints
#Primaryanforeignkeyconstraintsinmysql
#primaryandforeignkeytutorialinmysql
#howtocreatetablewithprimarykeyinmysql
#howtocreatetablewithforeignkeyinmysql
#mysqlprimarykey
#mysqlforeignkey
#howtouseprimarykey
#howtouseforeignkey
#learnmysql
#primarykeytutorial
#foreignkeytutorial
#howtouseprimarykeyandforeignkeyinmysql
#createprimarykeyinmysql
#mysqldatabase
#mysqltutorial
#mysqltutorialforbeginners
#mysql
#mysqldba
#mysqldb
Рекомендации по теме
join shbcf.ru