Skip to content
Question

Q.What will be the output of the following SQL queries :

(i) SELECT RIGHT(“CHANDRAYAN3”,4);
(ii) SELECT ROUND(76345.456,2);
CBSECBSE Class XII Board 2024Subjective· 2mImportance★★★★★
🔒 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 first query extracts the rightmost four characters from the string "CHANDRAYAN3", returning "YAN3". The second query rounds the number 76345.456 to two decimal places, returning 76345.46.

SQL provides a rich toolkit of built-in functions that manipulate data in predictable, powerful ways. String functions let you slice, transform, and extract portions of text, while numeric functions handle mathematical operations like rounding and truncation. Understanding what these functions do—and how they behave with different inputs—is essential for writing queries that shape raw data into exactly the form you need.

The RIGHT function belongs to the family of string extraction functions. It takes two arguments: a string and a number. The function counts from the end of the string and returns that many characters. Think of it as reaching in from the right side and pulling out a substring of the specified length.

When you execute SELECT RIGHT("CHANDRAYAN3",4);, the function examines the string "CHANDRAYAN3"—which contains eleven characters in total—and extracts the four rightmost ones. Counting backwards, those characters are Y, A, N, and 3. The output is therefore "YAN3".

Note

If you asked for more characters than the string contains, RIGHT simply returns the entire string. It does not throw an error or pad the result with extra characters.

The ROUND function operates in the numeric domain. It takes a number and a precision argument, then returns that number rounded to the specified number of decimal places. The rounding follows standard mathematical rules: if the digit immediately after your cutoff point is 5 or greater, you round up; otherwise, you round down. …

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.