Ms Access Relationship
Ms Access Relationship
RELATIONSHIP
DEFINATION OF RELATIONSHIP
DEFINATION: A Relationship is where two or more tables are linked through a specific
relation through keys. It helps improve table structures and reduce redundant data.
Relationships define how tables are connected to each other through keys.
Primary Key:
The primary key is a column or set of columns that uniquely identifies each record
in a table.
It enforces entity integrity by ensuring that each row can be uniquely identified.
Foreign Key:
A foreign key is a column or set of columns in a table that refers to the primary key
of another table.
It establishes relationships between tables, allowing data in one table to be linked to
data in another.
TYPES OF RELATIONSHIP
One-to-One Relationship
Under One-to-One (1:1) relationship, an instance of entity P is related to instance of entity Q
and an instance of entity Q is related to instance of entity P.
Let us see an example −
A person can have only one passport, and a passport is assigned to a single person.
TYPES OF RELATIONSHIP CONT……..
One-to-Many Relationship
Under One-to-Many (1:N) relationship, an instance of entity P is related to more than one
instance of entity Q and an instance of entity Q is related to more than one instance of entity P.
Let us see an example −
A Person can have more than one Bank Accounts but a bank account can have at most one
person as account holder.
TYPES OF RELATIONSHIP CONT……..
Many-to-Many Relationship
Under Many-to-Many (N:N) relationship, more than one instance of entity P is related to
more than one instance of entity Q. For more than one instance of entity Q is related to
more than one instance of entity P.
Let us see an example −
The relationship of services between many students and teachers