INSERT Function in SQLThe INSERT string function of Structured Query Language allows you to insert the string or character within the given string at the fixed position. Syntax of INSERT String FunctionSyntax1: This syntax uses INSERT function with the column name of the SQL table: Output:
Example 2: The following SELECT query inserts the 'C' character at the first position in the given word: Output:
Example 3: The following SELECT query inserts the 'Capital' sub-string before 'of' word: Output:
Example 4: The following SELECT query inserts the 'Tpoint' string at the fifth position in the 'Java Excel' string: Output:
Example 5: This example uses the INSERT function with the table in Structured query Language. Now, we create the new table in SQL, which helps to understand each string function. The syntax for creating the new table in the SQL database is as follows: The following CREATE statement creates the Worker_Grade table: The below INSERT queries insert the records of Workers with Grades, Salaries, and Remarks in the Worker_Grade table: The following SELECT statement displays the inserted records of the above Worker_Grade table:
The following SELECT query uses the FORMAT function with the First_Name column of the above Worker_Grade table: This SQL statement inserts the 'Aman' sub-string at the first position in the first name of each worker Output:
Next TopicBIT_LENGTH Function in SQL |