Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Multi-Org vs Single Org
00:00
5 left

Multi-Org vs Single Org

MediumSQL · PostgreSQL

Problem

Can you explain the difference between Multi-Org and Single Org approaches in Salesforce and the tradeoffs?

Using the provided Salesforce-style org and account tables, write a SQL query that quantifies the two approaches for comparison.

Output

  1. One row per architecture, ordered Multi-Org before Single Org
  2. Columns: architecture, org_count, account_count, unique_customer_count, missing_customer_key_count, duplicate_account_count, and avg_accounts_per_org
  3. duplicate_account_count counts repeated non-null customer keys within each architecture

Schema

salesforce_orgs
ColumnTypeDescription
org_idPKINTUnique Salesforce org identifier
deployment_idVARCHAR(20)Deployment grouping identifier
architectureVARCHAR(20)Org architecture, Multi-Org or Single Org
regionVARCHAR(30)Primary operating region
statusVARCHAR(20)Org lifecycle status
account_records
ColumnTypeDescription
account_idPKINTUnique account record identifier
org_idINTSalesforce org containing the account
customer_keyVARCHAR(30)Enterprise customer identifier used to detect duplicates
account_nameVARCHAR(100)Salesforce account name
Tablessalesforce_orgsaccount_records
Interviewer

Your question is Multi-Org vs Single Org. Start with the requirements and the two tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.