MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What will be the output of the query:Select Substring(’mysql application’, 3, 3)
A
app
B
mysql
C
application
D
sql
Explanation: 

Detailed explanation-1: -SELECT *FROM yourTableName ORDER BY RIGHT(yourColumnName, 3) yourSortingOrder; Just replace the ‘yourSortingOrder’ to ASC or DESC to set the ascending or descending order respectively.

Detailed explanation-2: -To fetch the first alphabet from the strings, use LEFT(). This method allows you to return characters from the left of the string.

Detailed explanation-3: -The SUBSTRING() function extracts a substring from a string (starting at any position). Note: The SUBSTR() and MID() functions equals to the SUBSTRING() function.

Detailed explanation-4: -SUBSTRING() function in MySQL function in MySQL is used to derive substring from any given string . It extracts a string with a specified length, starting from a given location in an input string. The purpose of substring is to return a specific portion of the string.

There is 1 question to complete.