Skip to content
Question

Q.What will be the result of the following SQL command ? SELECT LENGTH ('Data Base'); (Note : There is single space between the words Data and Base.) (A) 7 (B) 8 (C) 9 (D) Error

CBSECBSE Class XII Board 2026MCQ· 1mImportance★★★★★
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

The LENGTH function counts every character in the string including spaces, so 'Data Base' returns 9.

The LENGTH function in SQL is one of the most straightforward string functions you'll encounter. It does exactly what its name suggests: it counts the number of characters in a string and returns that count as an integer. The beauty of this function lies in its simplicity, but that simplicity can sometimes trip up students who forget one crucial detail.

When SQL evaluates LENGTH('Data Base'), it examines the string character by character. The string contains:

  • The letter D
  • The letter a
  • The letter t
  • The letter a
  • A space character (this is the key!)
  • The letter B
  • The letter a
  • The letter s
  • The letter e

That gives us a total of nine characters. The space between "Data" and "Base" is not invisible to the function — it's a legitimate character that occupies a position in the string, just like any letter or number would. Many students instinctively think of spaces as "nothing" or as mere separators, but in the world of string processing, a space is as real as any other character. …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.