Advertisement

Part 8.12 string operation in sql in hindi with example

Part 8.12 string operation in sql in hindi with example Phone no: 9958021083
• Counselling Guruji is our latest product & a well-structured program that answers all your queries related to Career/GATE/NET/PSU’s/Private Sector etc.
You can register for the program at:
You can check out the brochure at:

• Check out our website

• Please spare some time and fill this form so that we can know about you and what you think about us:


• Your review/recommendation and some words can help validating our quality of content and work
so Please do the following: -
1) Give us a 5 star review with comment on Google

2) Follow our Facebook page and give us a 5 star review with comments

3) Follow us on Instagram

4)Follow us on Quora


String Operations

• SQL specifies strings by enclosing them in single quotes, for example, ’Computer’.
• The SQL standard specifies that the equality operation on strings is case sensitive; as a result the expression ‘Computer’ = ’compute
• r’ evaluates to false. However, some database systems, such as MySQL and SQL Server, do not distinguish uppercase from lowercase when matching strings; as a result, would evaluate to true on these databases. This default behavior can, however, be changed, either at the database level or at the level of specific attributes.
• SQL also permits a variety of functions on character strings, such as concatenating, extracting substrings, finding the length of strings, converting strings to uppercase and lowercase, removing spaces at the end of the string and so on.
• There are variations on the exact set of string functions supported by different database systems.
• A single quote character that is part of a string can be specified by using two single quote characters; for example, the string It’s right can be specified by It”s right.
• Pattern matching can be performed on strings, using the operator like. We describe patterns by using two special characters:
o Percent (%): The % character matches any substring.
o Underscore (_): The _ character matches any character.

• Patterns are case sensitive; that is, uppercase characters do not match lowercase characters, or vice versa. To illustrate pattern matching, we consider the following examples:

• ’Amit%’ matches any string beginning with “Amit”.
• ’%Comp%’ matches any string containing “Comp” as a substring, for example, ’Intro to Computer Science’, and ’Computational Biology’.
• ’_ _ _’ matches any string of exactly three characters.
• ’_ _ _%’ matches any string of at least three characters.

Q Write a SQL query to find all the branch name who have exactly 5 character in their name ?
Select branch_name
from branch
Where branch_name like ‘_ _ _ _ _’


Q Write a SQL query to find all the customer name who have ‘kumar’ in their name ?
Select customer_name
from customer
Where customer_name like ‘%kumar%’

• For patterns to include the special pattern characters (that is, % and_), SQL allows the specification of an escape character. The escape character is used immediately before a special pattern character to indicate that the special pattern character is to be treated like a normal character. We define the escape character for a like comparison using the escape keyword. To illustrate, consider the following patterns, which use a backslash (\) as the escape character:
• like ’ab\%cd%’ escape ’\’ matches all strings beginning with “ab%cd”.
• like ’ab\\cd%’ escape ’\’ matches all strings beginning with “ab\cd”.
• SQL allows us to search for mismatches instead of matches by using the not like comparison operator. Some databases provide variants of the like operation which do not distinguish lower and upper case.
• SQL:1999 also offers a similar to operation, which provides more powerful pattern matching than the like operation; the syntax for specifying patterns is similar to that used in Unix regular expressions.
string operation in sql,pattern matching in sql in hindi,underscore in sql,percent operation in sql,sql string functions,pattern matching in sql in hindi,substring in sql in hindi,prefix operation in sql,postfix operation in sqlstring operation in sql,pattern matching in sql in hindi,underscore in sql,percent operation in sql,sql string functions,pattern matching in sql in hindi,substring in sql in hindi,prefix operation in sql,postfix operation in sql

string operation in sql,pattern matching in sql in hindi,underscore in sql,percent operation in sql,sql string functions,substring in sql in hindi,prefix operation in sql,postfix operation in sql,

Post a Comment

0 Comments