English

Write suitable SQL query for the following: Display the position of occurrence of the string ‘COME’ in the string ‘WELCOME WORLD’.

Advertisements
Advertisements

Question

Write suitable SQL query for the following:

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

One Line Answer
Advertisements

Solution

select INSTR('WELCOME WORLD','COME');

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

APPEARS IN

RELATED QUESTIONS

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


Which of the following belongs to an "aggregate function"?


Assertion (A): COUNf function ignores DISTINCT

Reason (R): DISTINCT ignores the duplicate values.


Which of the following is not an aggregate function?


The char() function in MySql is an example of ______. 


What will be returned by the given query? select mid("Computer", 2, 4) = ______.


What will be returned by the given query? select substr("Computer", 4) = ______.


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


What will be returned by the given query? SELECT RIGHT("LEFT", 2) = ______.


"COUNT" keyword belongs to which categories in Mysql?


The ______ function returns m raised to the nth power.


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 DAYOFYEAR('2015-01-10') = ______.


Which function will be used to remove only the trailing spaces from a string?


What is the general format of UPPER() return type?


Site any two differences between Single Row Functions and Aggregate Functions.


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

To display the specified number of characters from a particular position of the given string.


Write the output produced by the following SQL statement:

SELECT LENGTH("Informatics Practices");


Write the output produced by the following SQL statement:

SELECT    YEAR(“1979/11/26”),
MONTH(“1979/11/26”),    DAY(“1979/11/26”), MONTHNAME(“1979/11/26”);


Write the output produced by the following SQL statement:

SELECT    LEFT("INDIA", 3),    RIGHT("Computer Science", 4), 


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 type of values will not be considered by SQL while executing the following statement?

SELECT COUNT(column name) FROM inventory;


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:

Round off the value 23.78 to one decimal place.


Write suitable SQL query for the following:

Display the remainder of 100 divided by 9.


Explain the following SQL function using a suitable example.

UCASE()


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


Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×