Question 12 Concept of foreign keys
MCQS preparation MCQS preparation
41 subscribers
No views
0

 Published On Premiered 20 hours ago

In this video, I break down the difference between Primary Key and Foreign Key, two essential concepts in database management systems (DBMS).
The difference between Referenced and Referencing Relations:
Referenced Relation: The table that contains the Primary Key.
Referencing Relation: The table that uses the Foreign Key to reference the Primary Key from the other table.

Imagine you're managing a database for a school. In the Students table, each student has a unique ID number. This ID is the Primary Key that ensures every student is uniquely identifiable. In the Courses table, you want to record which courses each student is taking. Instead of entering all the student information again, you can simply use the Foreign Key (Student_ID) in the Courses table to link each course to a specific student from the Students table.

In this scenario:

The Students table is the Referenced Relation because it contains the unique Primary Key (StudentID).
The Courses table is the Referencing Relation because it uses the Foreign Key (StudentID) to connect each course to a student from the Students table.

show more

Share/Embed