Strings

📝 Strings

Total Questions: 7
Click an answer to select it, then click "Check Answers" to see your results.
Question 1

Which function would you use to remove leading and trailing spaces from a customer's full name before comparing it in a WHERE clause? 

A.

A. LENGTH

B.

B. TRIM

C.

C. LPAD

D.

D. REPLACE

Question 2

What does the **LENGTH** function return in MySQL?

A.

A) Number of bytes in a string

B.

B) Length of the string in pixels

C.

C) Number of words in a string

D.

D) Number of characters in a string

Question 3

What does the **CONCAT** function do when joining multiple strings without any explicit separators?

A.

A. Adds spaces between all strings automatically

B.

B. Joins strings directly without spaces

C.

C. Ignores NULL values and skips them

D.

D. Converts numbers to strings first

Question 4

If a string is longer than the target length in LPAD or RPAD, what happens?

A.

A. It's truncated to the target length.

B.

B. Padding characters are appended anyway.

C.

C. The original string is returned unchanged.

D.

D. An error is raised.

Question 5

What is the primary purpose of using **UPPER()** or **LOWER()** functions in a **WHERE** clause?

A.

A) To sort results alphabetically

B.

B) To normalize text case for case-insensitive comparisons

C.

C) To combine multiple columns into one

D.

D) To filter by numeric values

Question 6

Why use **LOWER** with SUBSTRING_INDEX in email domain filtering?

A.

A. To make comparisons case-insensitive

B.

B. To shorten the string

C.

C. To extract only uppercase domains

D.

D. To reverse the string

Question 7

What does the **REPLACE** function do in MySQL?

A.

A) Reverses the characters in a string

B.

B) Finds the position of a substring

C.

C) Replaces all occurrences of a substring with another substring

D.

D) Converts a string to lowercase

Quiz Complete!

Score: 0 / 7