ITP

BSc IT - Database Management System

Define Primary key and Foreign key.

In : BSc IT Subject : Database Management System

Primary Key is a column (or a combination of columns) that uniquely identifies each row in a table. It must have unique values and cannot contain nulls. For example, in a Students table, the StudentID can be the primary key because it is different for each student.

A Foreign Key , on the other hand, is a column in one table that refers to the Primary Key in another table. It is used to link or relate two tables together and ensure referential integrity . For example, in an Orders table, the StudentID can be a foreign key that connects each order to the student who placed it.

 

About us

A truly open platform where you may ask questions and get answers. We also provide comprehensive and easy-to-understand answers to question papers.  discover...

Site status

Flag Counter

Privacy Policy

Sitemap