New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce DEX-450 Exam - Topic 12 Question 22 Discussion

Actual exam question for Salesforce's DEX-450 exam
Question #: 22
Topic #: 12
[All DEX-450 Questions]

What is the maximum number of SOQL queries used by the following code? List aList = [SELECT Id FROM Account LIMIT 5]; for (Account a : aList){ List cList = [SELECT Id FROM Contact WHERE AccountId = :a.Id); }

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

0/2000 characters
Tayna
4 months ago
I’m surprised it’s that many! I would have guessed fewer.
upvoted 0 times
...
Pansy
4 months ago
Wait, are you sure? I thought it was only 1 query.
upvoted 0 times
...
Kallie
4 months ago
Totally agree with Earleen, that makes sense!
upvoted 0 times
...
Dominga
4 months ago
I think it's actually just 2 queries.
upvoted 0 times
...
Earleen
4 months ago
It's 6 queries total. 5 for the accounts and 1 for the contacts.
upvoted 0 times
...
Iraida
5 months ago
I’m a bit confused about the inner loop. Does it count as one query per account? I thought it might just be 2 total.
upvoted 0 times
...
Tran
5 months ago
If I recall correctly, the outer query counts as one, and then the inner query runs for each account, so that makes it 6, right?
upvoted 0 times
...
Jerry
5 months ago
I remember something about SOQL limits, but I’m not sure if it’s 5 or 6 total. I feel like I’ve seen a similar question before.
upvoted 0 times
...
Britt
5 months ago
I think the first query gets 5 accounts, but then there’s a query inside the loop for each account, so that could be tricky.
upvoted 0 times
...
Louann
5 months ago
Hmm, this is a tricky one. I'm leaning towards the Text Date field type, since that could potentially show trending data over time. But I'm not 100% confident in that answer.
upvoted 0 times
...
Jospeh
5 months ago
Hmm, I'm a bit torn on this one. The client wants to complete the migration as soon as possible, so option A with multiple ETL rounds might be the fastest approach. But then again, the manual authoring for the unique pages in option B could be more reliable. I'll have to think this through a bit more.
upvoted 0 times
...
Sophia
5 months ago
Hmm, I'm a bit confused by the SAVEPOINT and ROLLBACK commands here. I'll need to walk through the steps to understand how the table is affected at each point.
upvoted 0 times
...
Tawna
5 months ago
I remember that in our last review session, we discussed the importance of exit-phase reviews, but I'm not sure if they should be formal or lightweight for this scenario.
upvoted 0 times
...

Save Cancel