Salesforce Relationships associate objects with other objects. it is a 2-way association between 2 objects.
For example, a relationship connect an object to another and works as a foreign key.
In other words, if there is an object name student and another one is a school and we need to connect both objects to identify which student is belongs to which school then we can create a relationship field in the student object and it contains an Id and in student object, it is foreign ken but in school object, it behaves like a primary key and we can use all fields information in student object via a relationship field.
Types of relationships in the salesforce
Master-Detail: – A parent-child relationship that is strongly bonded to each other for example if we delete the parent object then the child object will be deleted automatically and when we are going to create a record in the child object then a master-detail relationship field will require.
Lookup:- Also a parent-child relationship but it is not strongly bound like master-details and not required when creating a record in the child object.
Many-to-many:- A many-to-many relationship allows each record of one object to be linked to multiple records from another object and vice versa.
for example, if you need to create a job object and there are various job profiles and also need to create a candidate object where you want to store candidates’ records and one candidate can apply for various profiles jobs then you need to create an object which will be known as junction object and it has the relationship between both objects and it works like a many-to-many relationship.
Salesforce Relationship video in Hindi: https://www.youtube.com/watch?v=E6XjVkbWmDM