SlideShare a Scribd company logo
String
Functions in SQL
•SQL string functions are used primarily for string
manipulation.
•Employee
SELECT * FROM employee;
• The initcap() function converts the first letter of each word in a string
to upper case, and converts any remaining characters in each word
to lowercase.
Query: SELECT initcap(ename) FROM employee;
Initcap(
)
• UCASE () is a synonym for UPPER ().
Returns the string str with all characters changed to uppercase according to
the current character set mapping.
Query: SELECT UPPER(ename) FROM employee;
UPPER(str)/UCASE(s
tr)
* LCASE () is a synonym for LOWER ().
* Returns the string str with all characters changed to lowercase
according to the current character set mapping.
Example1: SELECT lower(ename) from employee ;
LOWER(str)/ LCASE(str)
* Returns the length of the string str measured in bytes. A multi-byte
character counts as multiple bytes. This means that for a string
containing five two-byte characters,
LENGTH() returns 10, whereas CHAR_LENGTH() returns 5.
Query: SELECT LENGTH('ename') from employee ;
LENGTH(str)
• Returns the string str with all remstr prefixes or suffixes removed. If
none of the specifiers BOTH, LEADING, or TRAILING is given,
BOTH is assumed. remstr is optional and, if not specified, spaces
are removed.
Example: SELECT TRIM(‘ reena ') from dual;
TRIM
([{BOTH | LEADING | TRAILING} [remstr] FROM] str)/
TRIM([remstr FROM] str)
Example: SELECT TRIM(LEADING ‘#' FROM ‘###reena###') from
dual;
TRIM
{LEADING}
Example: SELECT TRIM(BOTH ‘#' FROM ‘###reena###') from dual;
TRIM {BOTH}
Example: SELECT TRIM(TRAILING ‘#' FROM ‘###reena###');
TRIM
{TRAILING}
• Returns the string str with trailing space characters removed.
Example: SELECT RTRIM(‘muskan ') from dual;
RTRIM(str)
• Returns the string str with leading space characters removed.
Example: SELECT LTRIM(‘ muskan') from dual;
LTRIM(str)
• Returns the string str, left-padded with the string pad str to a length of len
characters. If str is longer than len, the return value is shortened to len
characters.
Example: SELECT LPAD(‘11',4,’22') from dual;
LPAD(str,len,padstr)
• Returns the string str, right-padded with the string pad str to a length of len
characters. If str is longer than len, the return value is shortened to len
characters.
Example: SELECT RPAD(‘11’,4, ‘22') from dual;
RPAD(str,len,padstr)
• Returns the string that results from concatenating the arguments. May have
one or more arguments. If all arguments are non-binary strings, the result is
a non-binary string. If the arguments include any binary strings, the result is
a binary string. A numeric argument is converted to its equivalent binary
string form; if you want to avoid that, you can use an explicit type cast, as in
this:
Example : SELECT CONCAT( ename, hire_date) FROM employee;
CONCAT (str1,str2,...)
• Returns the string str with all occurrences of the string from_str replaced by
the string to_str. REPLACE() performs a case-sensitive match when
searching from_str.
Example: SELECT REPLACE(‘RRR.com', ‘R', ‘Rr’) from dual;
REPLACE(str,from_str,to_st
r)
• Returns the string str with the order of the characters reversed.
Example: SELECT REVERSE('abcd') from dual;
REVERSE(str)
• Returns the numeric value of the leftmost character of the string str. Returns
0 if str is the empty string. Returns NULL if str is NULL. ASCII() works for
characters with numeric values from 0 to 255.
Example: SELECT ASCII('2') FROM DUAL;
ASCII(str)
string functions in SQL ujjwal matoliya.pptx

More Related Content

Similar to string functions in SQL ujjwal matoliya.pptx

Handling of character strings C programming
Handling of character strings C programmingHandling of character strings C programming
Handling of character strings C programming
Appili Vamsi Krishna
 
stringsinpython-181122100212.pdf
stringsinpython-181122100212.pdfstringsinpython-181122100212.pdf
stringsinpython-181122100212.pdf
paijitk
 
Python Strings Methods
Python Strings MethodsPython Strings Methods
Python Strings Methods
Mr Examples
 
Strings
StringsStrings
Strings
Dhiviya Rose
 
Python data handling
Python data handlingPython data handling
Python data handling
Prof. Dr. K. Adisesha
 
SQL for pattern matching (Oracle 12c)
SQL for pattern matching (Oracle 12c)SQL for pattern matching (Oracle 12c)
SQL for pattern matching (Oracle 12c)
Logan Palanisamy
 
Computer Programming Utilities the subject of BE first year students, and thi...
Computer Programming Utilities the subject of BE first year students, and thi...Computer Programming Utilities the subject of BE first year students, and thi...
Computer Programming Utilities the subject of BE first year students, and thi...
jr2710
 
MySQL 5.7 String Functions
MySQL 5.7 String FunctionsMySQL 5.7 String Functions
MySQL 5.7 String Functions
Francesco Marino
 
String (Computer programming and utilization)
String (Computer programming and utilization)String (Computer programming and utilization)
String (Computer programming and utilization)
Digvijaysinh Gohil
 
String notes
String notesString notes
String notes
Prasadu Peddi
 
Mysql1
Mysql1Mysql1
Mysql1
rajikaa
 
Regular Expressions 101 Introduction to Regular Expressions
Regular Expressions 101 Introduction to Regular ExpressionsRegular Expressions 101 Introduction to Regular Expressions
Regular Expressions 101 Introduction to Regular Expressions
Danny Bryant
 
strings
stringsstrings
strings
teach4uin
 
String & its application
String & its applicationString & its application
String & its application
Tech_MX
 
Variables In Php 1
Variables In Php 1Variables In Php 1
String in c programming
String in c programmingString in c programming
String in c programming
Devan Thakur
 
Python programming : Strings
Python programming : StringsPython programming : Strings
Python programming : Strings
Emertxe Information Technologies Pvt Ltd
 
5. string
5. string5. string
Php String And Regular Expressions
Php String  And Regular ExpressionsPhp String  And Regular Expressions
Php String And Regular Expressions
mussawir20
 
Space Efficient Suffix Array Construction using Induced Sorting LMS Substrings
Space Efficient Suffix Array Construction using Induced Sorting LMS SubstringsSpace Efficient Suffix Array Construction using Induced Sorting LMS Substrings
Space Efficient Suffix Array Construction using Induced Sorting LMS Substrings
ijistjournal
 

Similar to string functions in SQL ujjwal matoliya.pptx (20)

Handling of character strings C programming
Handling of character strings C programmingHandling of character strings C programming
Handling of character strings C programming
 
stringsinpython-181122100212.pdf
stringsinpython-181122100212.pdfstringsinpython-181122100212.pdf
stringsinpython-181122100212.pdf
 
Python Strings Methods
Python Strings MethodsPython Strings Methods
Python Strings Methods
 
Strings
StringsStrings
Strings
 
Python data handling
Python data handlingPython data handling
Python data handling
 
SQL for pattern matching (Oracle 12c)
SQL for pattern matching (Oracle 12c)SQL for pattern matching (Oracle 12c)
SQL for pattern matching (Oracle 12c)
 
Computer Programming Utilities the subject of BE first year students, and thi...
Computer Programming Utilities the subject of BE first year students, and thi...Computer Programming Utilities the subject of BE first year students, and thi...
Computer Programming Utilities the subject of BE first year students, and thi...
 
MySQL 5.7 String Functions
MySQL 5.7 String FunctionsMySQL 5.7 String Functions
MySQL 5.7 String Functions
 
String (Computer programming and utilization)
String (Computer programming and utilization)String (Computer programming and utilization)
String (Computer programming and utilization)
 
String notes
String notesString notes
String notes
 
Mysql1
Mysql1Mysql1
Mysql1
 
Regular Expressions 101 Introduction to Regular Expressions
Regular Expressions 101 Introduction to Regular ExpressionsRegular Expressions 101 Introduction to Regular Expressions
Regular Expressions 101 Introduction to Regular Expressions
 
strings
stringsstrings
strings
 
String & its application
String & its applicationString & its application
String & its application
 
Variables In Php 1
Variables In Php 1Variables In Php 1
Variables In Php 1
 
String in c programming
String in c programmingString in c programming
String in c programming
 
Python programming : Strings
Python programming : StringsPython programming : Strings
Python programming : Strings
 
5. string
5. string5. string
5. string
 
Php String And Regular Expressions
Php String  And Regular ExpressionsPhp String  And Regular Expressions
Php String And Regular Expressions
 
Space Efficient Suffix Array Construction using Induced Sorting LMS Substrings
Space Efficient Suffix Array Construction using Induced Sorting LMS SubstringsSpace Efficient Suffix Array Construction using Induced Sorting LMS Substrings
Space Efficient Suffix Array Construction using Induced Sorting LMS Substrings
 

More from ujjwalmatoliya

kisan bill ujjwal matoliya.pptx
kisan bill ujjwal matoliya.pptxkisan bill ujjwal matoliya.pptx
kisan bill ujjwal matoliya.pptx
ujjwalmatoliya
 
Data Frames and Scatterplots in R language ujjwal matoliya.pptx
Data Frames and Scatterplots in R language ujjwal matoliya.pptxData Frames and Scatterplots in R language ujjwal matoliya.pptx
Data Frames and Scatterplots in R language ujjwal matoliya.pptx
ujjwalmatoliya
 
Floyd’s and Warshal’s Algorithm ujjwal matoliya.pptx
Floyd’s and Warshal’s Algorithm ujjwal matoliya.pptxFloyd’s and Warshal’s Algorithm ujjwal matoliya.pptx
Floyd’s and Warshal’s Algorithm ujjwal matoliya.pptx
ujjwalmatoliya
 
congestion ujjwal matoliya.pptx
congestion ujjwal matoliya.pptxcongestion ujjwal matoliya.pptx
congestion ujjwal matoliya.pptx
ujjwalmatoliya
 
Global Attributes Window Event Attributes Form Events Ujjwal matoliya.pptx
Global Attributes Window Event Attributes Form Events Ujjwal matoliya.pptxGlobal Attributes Window Event Attributes Form Events Ujjwal matoliya.pptx
Global Attributes Window Event Attributes Form Events Ujjwal matoliya.pptx
ujjwalmatoliya
 
Instruction format UJJWAL MATOLIYA.pptx
Instruction format UJJWAL MATOLIYA.pptxInstruction format UJJWAL MATOLIYA.pptx
Instruction format UJJWAL MATOLIYA.pptx
ujjwalmatoliya
 
javascript function ujjwal matoliya.pptx
javascript function ujjwal matoliya.pptxjavascript function ujjwal matoliya.pptx
javascript function ujjwal matoliya.pptx
ujjwalmatoliya
 
jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
 jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
ujjwalmatoliya
 
compiler design ujjwal matoliya 2nd sem MCA.pptx
compiler design ujjwal matoliya 2nd sem MCA.pptxcompiler design ujjwal matoliya 2nd sem MCA.pptx
compiler design ujjwal matoliya 2nd sem MCA.pptx
ujjwalmatoliya
 
3 address code ujjwal matoliya.pptx
3 address code ujjwal matoliya.pptx3 address code ujjwal matoliya.pptx
3 address code ujjwal matoliya.pptx
ujjwalmatoliya
 
2-3 tree ujjwal matoliya .pptx
2-3 tree ujjwal matoliya .pptx2-3 tree ujjwal matoliya .pptx
2-3 tree ujjwal matoliya .pptx
ujjwalmatoliya
 
Graph in Discrete mathemaetics.pptx
Graph in Discrete mathemaetics.pptxGraph in Discrete mathemaetics.pptx
Graph in Discrete mathemaetics.pptx
ujjwalmatoliya
 
Quick Sort in data structure.pptx
Quick Sort in data structure.pptxQuick Sort in data structure.pptx
Quick Sort in data structure.pptx
ujjwalmatoliya
 
Hadoop With R language.pptx
Hadoop With R language.pptxHadoop With R language.pptx
Hadoop With R language.pptx
ujjwalmatoliya
 
LOGIC FAMILY.pptx
LOGIC FAMILY.pptxLOGIC FAMILY.pptx
LOGIC FAMILY.pptx
ujjwalmatoliya
 
Transaction.pptx
Transaction.pptxTransaction.pptx
Transaction.pptx
ujjwalmatoliya
 
cyclomatic complecity.pptx
cyclomatic complecity.pptxcyclomatic complecity.pptx
cyclomatic complecity.pptx
ujjwalmatoliya
 
Congestion control algorithms.pptx
Congestion control algorithms.pptxCongestion control algorithms.pptx
Congestion control algorithms.pptx
ujjwalmatoliya
 
computer graphic.pptx
computer graphic.pptxcomputer graphic.pptx
computer graphic.pptx
ujjwalmatoliya
 
Game playing With AI.pptx
Game playing With AI.pptxGame playing With AI.pptx
Game playing With AI.pptx
ujjwalmatoliya
 

More from ujjwalmatoliya (20)

kisan bill ujjwal matoliya.pptx
kisan bill ujjwal matoliya.pptxkisan bill ujjwal matoliya.pptx
kisan bill ujjwal matoliya.pptx
 
Data Frames and Scatterplots in R language ujjwal matoliya.pptx
Data Frames and Scatterplots in R language ujjwal matoliya.pptxData Frames and Scatterplots in R language ujjwal matoliya.pptx
Data Frames and Scatterplots in R language ujjwal matoliya.pptx
 
Floyd’s and Warshal’s Algorithm ujjwal matoliya.pptx
Floyd’s and Warshal’s Algorithm ujjwal matoliya.pptxFloyd’s and Warshal’s Algorithm ujjwal matoliya.pptx
Floyd’s and Warshal’s Algorithm ujjwal matoliya.pptx
 
congestion ujjwal matoliya.pptx
congestion ujjwal matoliya.pptxcongestion ujjwal matoliya.pptx
congestion ujjwal matoliya.pptx
 
Global Attributes Window Event Attributes Form Events Ujjwal matoliya.pptx
Global Attributes Window Event Attributes Form Events Ujjwal matoliya.pptxGlobal Attributes Window Event Attributes Form Events Ujjwal matoliya.pptx
Global Attributes Window Event Attributes Form Events Ujjwal matoliya.pptx
 
Instruction format UJJWAL MATOLIYA.pptx
Instruction format UJJWAL MATOLIYA.pptxInstruction format UJJWAL MATOLIYA.pptx
Instruction format UJJWAL MATOLIYA.pptx
 
javascript function ujjwal matoliya.pptx
javascript function ujjwal matoliya.pptxjavascript function ujjwal matoliya.pptx
javascript function ujjwal matoliya.pptx
 
jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
 jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
 
compiler design ujjwal matoliya 2nd sem MCA.pptx
compiler design ujjwal matoliya 2nd sem MCA.pptxcompiler design ujjwal matoliya 2nd sem MCA.pptx
compiler design ujjwal matoliya 2nd sem MCA.pptx
 
3 address code ujjwal matoliya.pptx
3 address code ujjwal matoliya.pptx3 address code ujjwal matoliya.pptx
3 address code ujjwal matoliya.pptx
 
2-3 tree ujjwal matoliya .pptx
2-3 tree ujjwal matoliya .pptx2-3 tree ujjwal matoliya .pptx
2-3 tree ujjwal matoliya .pptx
 
Graph in Discrete mathemaetics.pptx
Graph in Discrete mathemaetics.pptxGraph in Discrete mathemaetics.pptx
Graph in Discrete mathemaetics.pptx
 
Quick Sort in data structure.pptx
Quick Sort in data structure.pptxQuick Sort in data structure.pptx
Quick Sort in data structure.pptx
 
Hadoop With R language.pptx
Hadoop With R language.pptxHadoop With R language.pptx
Hadoop With R language.pptx
 
LOGIC FAMILY.pptx
LOGIC FAMILY.pptxLOGIC FAMILY.pptx
LOGIC FAMILY.pptx
 
Transaction.pptx
Transaction.pptxTransaction.pptx
Transaction.pptx
 
cyclomatic complecity.pptx
cyclomatic complecity.pptxcyclomatic complecity.pptx
cyclomatic complecity.pptx
 
Congestion control algorithms.pptx
Congestion control algorithms.pptxCongestion control algorithms.pptx
Congestion control algorithms.pptx
 
computer graphic.pptx
computer graphic.pptxcomputer graphic.pptx
computer graphic.pptx
 
Game playing With AI.pptx
Game playing With AI.pptxGame playing With AI.pptx
Game playing With AI.pptx
 

Recently uploaded

ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 

Recently uploaded (20)

ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 

string functions in SQL ujjwal matoliya.pptx

  • 1.
  • 2. String Functions in SQL •SQL string functions are used primarily for string manipulation.
  • 4. • The initcap() function converts the first letter of each word in a string to upper case, and converts any remaining characters in each word to lowercase. Query: SELECT initcap(ename) FROM employee; Initcap( )
  • 5. • UCASE () is a synonym for UPPER (). Returns the string str with all characters changed to uppercase according to the current character set mapping. Query: SELECT UPPER(ename) FROM employee; UPPER(str)/UCASE(s tr)
  • 6. * LCASE () is a synonym for LOWER (). * Returns the string str with all characters changed to lowercase according to the current character set mapping. Example1: SELECT lower(ename) from employee ; LOWER(str)/ LCASE(str)
  • 7. * Returns the length of the string str measured in bytes. A multi-byte character counts as multiple bytes. This means that for a string containing five two-byte characters, LENGTH() returns 10, whereas CHAR_LENGTH() returns 5. Query: SELECT LENGTH('ename') from employee ; LENGTH(str)
  • 8. • Returns the string str with all remstr prefixes or suffixes removed. If none of the specifiers BOTH, LEADING, or TRAILING is given, BOTH is assumed. remstr is optional and, if not specified, spaces are removed. Example: SELECT TRIM(‘ reena ') from dual; TRIM ([{BOTH | LEADING | TRAILING} [remstr] FROM] str)/ TRIM([remstr FROM] str)
  • 9. Example: SELECT TRIM(LEADING ‘#' FROM ‘###reena###') from dual; TRIM {LEADING}
  • 10. Example: SELECT TRIM(BOTH ‘#' FROM ‘###reena###') from dual; TRIM {BOTH}
  • 11. Example: SELECT TRIM(TRAILING ‘#' FROM ‘###reena###'); TRIM {TRAILING}
  • 12. • Returns the string str with trailing space characters removed. Example: SELECT RTRIM(‘muskan ') from dual; RTRIM(str)
  • 13. • Returns the string str with leading space characters removed. Example: SELECT LTRIM(‘ muskan') from dual; LTRIM(str)
  • 14. • Returns the string str, left-padded with the string pad str to a length of len characters. If str is longer than len, the return value is shortened to len characters. Example: SELECT LPAD(‘11',4,’22') from dual; LPAD(str,len,padstr)
  • 15. • Returns the string str, right-padded with the string pad str to a length of len characters. If str is longer than len, the return value is shortened to len characters. Example: SELECT RPAD(‘11’,4, ‘22') from dual; RPAD(str,len,padstr)
  • 16. • Returns the string that results from concatenating the arguments. May have one or more arguments. If all arguments are non-binary strings, the result is a non-binary string. If the arguments include any binary strings, the result is a binary string. A numeric argument is converted to its equivalent binary string form; if you want to avoid that, you can use an explicit type cast, as in this: Example : SELECT CONCAT( ename, hire_date) FROM employee; CONCAT (str1,str2,...)
  • 17. • Returns the string str with all occurrences of the string from_str replaced by the string to_str. REPLACE() performs a case-sensitive match when searching from_str. Example: SELECT REPLACE(‘RRR.com', ‘R', ‘Rr’) from dual; REPLACE(str,from_str,to_st r)
  • 18. • Returns the string str with the order of the characters reversed. Example: SELECT REVERSE('abcd') from dual; REVERSE(str)
  • 19. • Returns the numeric value of the leftmost character of the string str. Returns 0 if str is the empty string. Returns NULL if str is NULL. ASCII() works for characters with numeric values from 0 to 255. Example: SELECT ASCII('2') FROM DUAL; ASCII(str)