Salesforce
CRT-450 · Question #49
A custom object Trainer_c has a lookup field to another custom object Gym___c. Which SOQL query will get the record for the Viridian City gym and it's trainers?
The correct answer is A. SELECT Id, (SELECT Id FROM Trainers) FROM Gym_C WHERE Name . Viridian City Gym'. See the full explanation below for the reasoning.
Question
A custom object Trainer_c has a lookup field to another custom object Gym___c. Which SOQL query will get the record for the Viridian City gym and it's trainers?
Options
- ASELECT Id, (SELECT Id FROM Trainers) FROM Gym_C WHERE Name . Viridian City Gym'
- BSELECT Id, (SELECT Id FROM Trainer_c) FROM Gym_c WHERE Name -Viridian City Gym'
- CSELECT ID FROM Trainer_c WHERE Gym__r.Name -Viridian City Gym'
- DSELECT Id, (SELECT Id FROM Trainers) FROM Gym_C WHERE Name -Viridian City Gym'
How the community answered
(41 responses)- A80% (33)
- B5% (2)
- C12% (5)
- D2% (1)
Community Discussion
No community discussion yet for this question.