Salesforce Certified Omnistudio Developer free question 8 / 10 · Domain 5: Data Mappers
A Data Mapper Extract returns Accounts sorted by the number of employees, from the smallest to the largest. Accounts with an unknown number of employees must be listed first. Which ORDER BY value does the Help describe?
- NumberOfEmployees ASC NULLS LAST
- NumberOfEmployees ASC NULLS FIRST
- NumberOfEmployees ASC, Name
- NumberOfEmployees DESC NULLS FIRST
Show the answer and explanation
Answer: B
Why this is correct
An ORDER BY value can include ASC or DESC and can add NULLS FIRST or NULLS LAST to place blank values at the beginning or the end. The Help example is the same case: sorting Accounts by the number of employees and listing the companies of unknown size first and the largest employers last uses NumberOfEmployees ASC NULLS FIRST. A comma-separated list of fields is a different feature, used to sort by several fields.
Why the other options are wrong
"NumberOfEmployees ASC NULLS LAST" … NULLS LAST places blank values at the end of the list. The unknown companies must come first.
"NumberOfEmployees DESC NULLS FIRST" … DESC sorts from the largest to the smallest. The Help example lists the unknown companies first and the largest employers last with ASC.
"NumberOfEmployees ASC, Name" … A comma-separated list sorts by several fields in order of precedence. It adds a second sort key and does not place blank values first.
Key points
ASC NULLS FIRST puts blanks first and the largest values last.