English

Explain the following SQL function using a suitable example. TRIM() - Informatics Practices

Advertisements
Advertisements

Question

Explain the following SQL function using a suitable example.

TRIM()

Short/Brief Note
Advertisements

Solution

TRIM(): It removes the leading and trailing spaces from the given string.

Example: SELECT TRIM(‘      Welcome world     ‘);

Output: Welcome world

shaalaa.com
Functions in SQL
  Is there an error in this question or solution?
2022-2023 (March) Sample

APPEARS IN

RELATED QUESTIONS

______ keyword is used to find out the number of values in a column?


Which method is used to get the row-id of the last modified row?


The MAX () function finds the


What will be the output of the following SQL statement? 

SELECT DAY NAME (2022-04-08) 


Assertion (A): COUNf function ignores DISTINCT

Reason (R): DISTINCT ignores the duplicate values.


Identify Single Row function of MySQL among the following.


What will be returned by the given query? select power(3, 2) = ______.


What will be returned by the given query? Select length(trim("ABC Public School")) = ______.


"COUNT" keyword belongs to which categories in Mysql?


Name a function of MySQL used to give position of the first occurrence of a string2 in string1.


What will be returned by the given query? SELECT MID('BoardExamination', 2, 4) = ______.


What will be returned by the given query? SELECT INSTR('INFORMATIONFORM', 'FOR') = ______.


Which of the following is not a date function?


Which statement is used to count the number of rows in table?


Write the name of the functions to perform the following operation:

To display the name of the month in which you were born.


Write the output produced by the following SQL statement:

SELECT LENGTH("Informatics Practices");


Write the output produced by the following SQL statement:

SELECT    LEFT("INDIA", 3),    RIGHT("Computer Science", 4),    MID("Informatics", 3, 4), SUBSTR("Practices", 3);


Predict the output of the code given below:

s="welcome2cs" 

n = len(s)
m=""
for i in range(0, n):
       if (s[i] >= 'a' and s[i] <= 'm'):
            m = m +s[i].upper()
 elif (s[i] >= 'n' and s[i] <= 'z'):
          m = m +s[i-1]
 elif (s[i].isupper()):
     m = m + s[i].lower()
 else:
     m = m +'&'
print(m)

Which one of the following is not an aggregate function?


Which one of the following functions are used to find the largest value from the given data in MySQL?


In SQL, which function is used to display the current date and time?


Write suitable SQL query for the following:

Display the position of occurrence of the string ‘COME’ in the string ‘WELCOME WORLD’.


Write suitable SQL query for the following:

Round off the value 23.78 to one decimal place.


Explain the following SQL function using a suitable example.

UCASE()


Explain the following SQL function using a suitable example.

MID()


Which function returns the sum of all elements of a list?


Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×