Salesforce Certified Platform Developer II — Question 147
Which two relationship queries use the proper syntax? (Choose two.)
Answer options
- A. SELECT Id, Name, Account__r.Name FROM Contact WHERE Account__r.Industry = 'Media'
- B. SELECT Name, (SELECT LastName FROM Contacts__r) FROM Account
- C. SELECT Name, (SELECT LastName FROM Contacts) FROM Account
- D. SELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = 'Media'
Correct answer: C, D
Explanation
The correct answers are C and D because they use the proper syntax for relationship queries in Salesforce. Option A is incorrect because it uses the wrong relationship field name (Account__r instead of Account), and option B is incorrect as it references a non-standard child relationship name (Contacts__r) which may not exist.