Beginner 15 min read

Relationships, Conceptually: Lookup vs Master-Detail

By the end of this lesson, you'll be able to:

  • Explain what a relationship between two objects means
  • Distinguish Lookup relationships from Master-Detail relationships at a conceptual level
  • Predict what happens to child records when a parent record is deleted, under each relationship type

Prerequisites: "Standard Objects vs Custom Objects"

Why relationships exist

Real business data is never isolated. A Contact doesn't float on its own — it belongs to a company (Account). A Case doesn't exist in a vacuum — it was raised by someone (Contact) about something. Relationships are how Salesforce expresses "this record is connected to that one."

This is also exactly what makes SOQL relationship queries and Apex's handling of related records possible — you'll see this concept again constantly starting in Module 3's data modules and Module "SOQL."

Lookup: a loose connection

A Lookup relationship is like writing someone's employer's name on a business card — it's a reference, but the two things are otherwise independent. If the company goes out of business, your business card doesn't get automatically shredded.

In Salesforce terms: if you delete the parent record in a Lookup relationship, the child record survives (though the lookup field on it becomes blank, or in some configurations, deletion of the parent is blocked entirely if children still reference it).

Master-Detail: ownership

A Master-Detail relationship is tighter — the child genuinely belongs to, and depends on, the parent. Think of it like the relationship between a shipping order and its line items: a line item without an order makes no sense on its own.

In Salesforce terms: deleting the parent (master) record in a Master-Detail relationship deletes every related child record too — this cascading behavior is the single most important practical difference to remember.

A visual comparison

LOOKUP                          MASTER-DETAIL
-------                         --------------
Account (parent)                Invoice__c (master)
   |  loosely referenced by         |  owns completely
   v                                v
Contact (child)                 Invoice_Line__c (detail)

Delete Account?                 Delete Invoice__c?
Contact survives.               Invoice_Line__c records
(lookup field blanks)           are deleted too.

A real business example: Manufacturing

A manufacturer might have a Master-Detail relationship from Production_Batch__c (master) to Quality_Check__c (detail) — a quality check genuinely doesn't mean anything without the batch it belongs to, so if a batch record is ever deleted, its quality checks should go with it. Meanwhile, Production_Batch__c might have a Lookup to Contact for "supervising engineer" — the batch should survive even if that engineer's contact record is later removed from the system.

Exercise

For a Customer Support scenario, would you make the relationship between Case and Case Comment a Lookup or a Master-Detail? Explain your reasoning using the 'does the child make sense without the parent' test from this lesson.

Show hint

Does a comment make sense floating around with no Case to belong to?

Relationships, Conceptually: Lookup vs Master-Detail Quiz

1. What happens to child records when their Master-Detail parent is deleted?

2. A Lookup relationship is generally a "looser" connection than a Master-Detail relationship.

Log in to submit the quiz and save your score.

My Notes

Log in to keep private notes on this lesson.

Questions about this lesson

No questions yet — be the first to ask.

Log in to ask a question about this lesson.

Summary

A relationship connects one object's records to another's — a Contact belongs to an Account, an Opportunity belongs to an Account. Lookup relationships are loose connections; Master-Detail relationships are tight, ownership-style connections where the child's fate depends on the parent.