SlideShare a Scribd company logo
1 of 20
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 programmingAppili Vamsi Krishna
 
stringsinpython-181122100212.pdf
stringsinpython-181122100212.pdfstringsinpython-181122100212.pdf
stringsinpython-181122100212.pdfpaijitk
 
Python Strings Methods
Python Strings MethodsPython Strings Methods
Python Strings MethodsMr Examples
 
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 FunctionsFrancesco Marino
 
String (Computer programming and utilization)
String (Computer programming and utilization)String (Computer programming and utilization)
String (Computer programming and utilization)Digvijaysinh Gohil
 
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 ExpressionsDanny Bryant
 
String & its application
String & its applicationString & its application
String & its applicationTech_MX
 
String in c programming
String in c programmingString in c programming
String in c programmingDevan Thakur
 
Php String And Regular Expressions
Php String  And Regular ExpressionsPhp String  And Regular Expressions
Php String And Regular Expressionsmussawir20
 
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 Substringsijistjournal
 

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.pptxujjwalmatoliya
 
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.pptxujjwalmatoliya
 
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.pptxujjwalmatoliya
 
congestion ujjwal matoliya.pptx
congestion ujjwal matoliya.pptxcongestion ujjwal matoliya.pptx
congestion ujjwal matoliya.pptxujjwalmatoliya
 
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.pptxujjwalmatoliya
 
Instruction format UJJWAL MATOLIYA.pptx
Instruction format UJJWAL MATOLIYA.pptxInstruction format UJJWAL MATOLIYA.pptx
Instruction format UJJWAL MATOLIYA.pptxujjwalmatoliya
 
javascript function ujjwal matoliya.pptx
javascript function ujjwal matoliya.pptxjavascript function ujjwal matoliya.pptx
javascript function ujjwal matoliya.pptxujjwalmatoliya
 
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.pptxujjwalmatoliya
 
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.pptxujjwalmatoliya
 
3 address code ujjwal matoliya.pptx
3 address code ujjwal matoliya.pptx3 address code ujjwal matoliya.pptx
3 address code ujjwal matoliya.pptxujjwalmatoliya
 
2-3 tree ujjwal matoliya .pptx
2-3 tree ujjwal matoliya .pptx2-3 tree ujjwal matoliya .pptx
2-3 tree ujjwal matoliya .pptxujjwalmatoliya
 
Graph in Discrete mathemaetics.pptx
Graph in Discrete mathemaetics.pptxGraph in Discrete mathemaetics.pptx
Graph in Discrete mathemaetics.pptxujjwalmatoliya
 
Quick Sort in data structure.pptx
Quick Sort in data structure.pptxQuick Sort in data structure.pptx
Quick Sort in data structure.pptxujjwalmatoliya
 
Hadoop With R language.pptx
Hadoop With R language.pptxHadoop With R language.pptx
Hadoop With R language.pptxujjwalmatoliya
 
cyclomatic complecity.pptx
cyclomatic complecity.pptxcyclomatic complecity.pptx
cyclomatic complecity.pptxujjwalmatoliya
 
Congestion control algorithms.pptx
Congestion control algorithms.pptxCongestion control algorithms.pptx
Congestion control algorithms.pptxujjwalmatoliya
 
Game playing With AI.pptx
Game playing With AI.pptxGame playing With AI.pptx
Game playing With AI.pptxujjwalmatoliya
 

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

URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 

Recently uploaded (20)

Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 

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)