Banking Contacts with Their Firms
Basic SolvedRelationship managers in the banking vertical want a call sheet of their contacts with the firm each one works for.
Return each Contact's LastName and its account's name (Account.Name) for contacts whose account is in the Banking industry.
Sample data
Account 3 records
| Name | Industry |
|---|---|
| Bluefin Bank | Banking |
| Acme Cloud | Technology |
| Harbor Credit | Banking |
Contact 4 records
| LastName | Account |
|---|---|
| Rao | Bluefin Bank |
| Singh | Acme Cloud |
| Patel | Harbor Credit |
| Iyer | null |
Expected result on the sample
| LastName | Account.Name |
|---|---|
| Rao | Bluefin Bank |
| Patel | Harbor Credit |
Row order does not matter. Only the columns above are compared; extra columns in your SELECT are fine.
Hints
- From Contact, the parent account is
Account. - You can filter on
Account.Industrydirectly.
What this tests
Dot notation walks from a child record to its parent in one query, both in the SELECT list and in the WHERE clause. It replaces the two-query pattern of loading contacts, collecting AccountIds and querying accounts. A contact with no account simply drops out of a filter on Account.Industry.
Datasets
Solved on this device only. Sign in with Google to keep your progress across devices.
Run on sample executes your query against the sample data shown on the left and displays the rows it returns. Submit checks it against the sample plus 2 hidden datasets, comparing your rows with the expected rows on each. Queries run in a real Salesforce org; the data is inserted for your run and rolled back afterwards.