WGU Data-Management-Foundations Question Answer
Which function removes only the leading spaces from a string?
LTRIM
LEFT
TRIM
REPLACE
TheLTRIM()function in SQL removesleading spaces(spaces at the beginning of a string) while keeping spaces at the end.
Example Usage:
sql
SELECT LTRIM(' Hello World') AS TrimmedText;
Output:
bash
'Hello World'
Why Other Options Are Incorrect:
Option B (LEFT) (Incorrect):Used for extracting a portion of a string. Example:
SELECT LEFT('Hello World', 5); -- Output: 'Hello'
Option C (TRIM) (Incorrect):Removesboth leading and trailing spaces, not just leading ones. Example:
SELECT TRIM(' Hello World '); -- Output: 'Hello World'
Option D (REPLACE) (Incorrect):Replaces occurrences of one substring with another but doesnot specifically remove spaces.
Thus, the correct answer isLTRIM(), which removes onlyleading spaces.
TESTED 01 Jan 2026
Copyright © 2014-2026 ACE4Sure. All Rights Reserved