Informatics Practices
Consider the given SQL string :
"12#All the Best!"
Write suitable SQL queries for the following :
(i) Returns the position of the first occurrence of the substring "the" in the given string.
(ii) To extract last five characters from the string.
SQL Queries
3 Likes
Answer
(i)
SELECT INSTR("12#All the Best!", 'the') AS the_position;
Output
+--------------+
| the_position |
+--------------+
| 8 |
+--------------+
(ii)
SELECT SUBSTR("12#All the Best!", -5) AS last_five;
Output
+-----------+
| last_five |
+-----------+
| Best! |
+-----------+
Answered By
1 Like
Related Questions
Rati is doing a course in networking. She is unable to understand the concept of URL. Help her by explaining it with the help of suitable example.
The python code written below has syntactical errors. Rewrite the correct code and underline the corrections made.
Import pandas as pd df = {"Technology" : ["Programming", "Robotics", "3D Printing"], "Time(in months)" : [4, 4, 3]} df = Pd.dataframe(df) Print(df)
Predict the output of the given Python code :
import pandas as pd list1 = [-10, -20, -30] ser = pd.Series(list1 * 2) print(ser)
Differentiate between the active digital footprint and passive digital footprints.