SlideShare a Scribd company logo
2
Most read
3
Most read
Types
There are two types of single-row character functions:
Case-manipulation functions
Character-manipulation functions
Case-Manipulation Functions
You use case-manipulation functions to change the case of character
strings. The types of case-manipulation functions
are LOWER , UPPER , and INITCAP .
Character Functions
Character-Manipulation Functions
You use character-manipulation functions to manipulate character
strings. The types of character-manipulation functions
are CONCAT , SUBSTRING , LEFT , RIGHT , TRIM , and REPLACE .
LOWER() function
The SQL LOWER() function is used to convert all characters of a
string to lower case.
Syntax:
LOWER(string)
UPPER() function
The SQL UPPER() function is used to convert all characters of a string
to uppercase.
Syntax:
UPPER(string)
INITCAP : This function converts alpha character values to uppercase for
the first letter of each word and all others in lowercase. The words in the
string is must be separated by either # or _ or space.
INITCAP(SQL course)
Character-Manipulative Functions
CONCAT : This function always appends ( concatenates ) string2 to the
end of string1. If either of the string is NULL, CONCAT function returns
the non-NULL argument. If both strings are NULL, CONCAT returns
NULL.
Syntax: CONCAT('String1', 'String2')
LENGTH : This function returns the length of the input string. If the input
string is NULL, then LENGTH function returns NULL and not Zero. Also,
if the input string contains extra spaces at the start, or in between or at the
end of the string, then the LENGTH function includes the extra spaces too
and returns the complete length of the string.
Syntax: LENGTH(Column|Expression)
SUBSTRING/SUBSTR : This function returns a portion of a string
from a given start point to an end point. If a substring length is not
given, then SUBSTR returns all the characters till the end of string
(from the starting position specified).
Syntax:SUBSTR('String',start-index,length_of_extracted_string)
LEFT()
•Definition: Extracts a specified number of characters from the left side of a
string.
•Syntax: LEFT(string, length)
•Example: SELECT LEFT('hello world', 5)
•Output: hello
RIGHT()
Definition: Extracts a specified number of characters from the right side of a
string.
Syntax: RIGHT(string, length)
Example: SELECT RIGHT('hello world', 5)
Output: world
TRIM()
Definition: Removes leading and trailing spaces from a string.
Syntax: TRIM([LEADING | TRAILING | BOTH] trim_character FROM
string)
Example: SELECT TRIM(' hello world ')
Output: hello world
REPLACE : This function searches for a character string and, if found,
replaces it with a given replacement string at all the occurrences of the
string. REPLACE is useful for searching patterns of characters and then
changing all instances of that pattern in a single function call.
Syntax:
REPLACE(Text, search_string, replacement_string)

More Related Content

PDF
Sql functions
ODP
PHP Web Programming
PPTX
Unit_I-Introduction python programming (1).pptx
PDF
Strings brief introduction in python.pdf
PPTX
String in programming language in c or c++
ODP
Mysql1
PPTX
Character Arrays and strings in c language
PDF
Spreadsheet text functions
Sql functions
PHP Web Programming
Unit_I-Introduction python programming (1).pptx
Strings brief introduction in python.pdf
String in programming language in c or c++
Mysql1
Character Arrays and strings in c language
Spreadsheet text functions

Similar to character function in database managemnet system (20)

PDF
Introduction to oracle functions
PPTX
string functions in SQL ujjwal matoliya.pptx
PPT
SQL select statement and functions
PDF
Python data handling
PPSX
Regular expressions in oracle
PPT
Introduction to Oracle Functions--(SQL)--Abhishek Sharma
PDF
Key functions in_oracle_sql
PDF
python1uhaibueuhERADGAIUSAERUGHw9uSS.pdf
PPT
Chapter-5.ppt
PPTX
PPTX
Day5 String python language for btech.pptx
PPTX
Bsc cs i pic u-4 function, storage class and array and strings
PPTX
Diploma ii cfpc u-4 function, storage class and array and strings
PPTX
strings in php how to use different data types in string
PDF
Functions torage class and array and strings-
PPTX
Btech i pic u-4 function, storage class and array and strings
PPTX
function, storage class and array and strings
PPTX
Mcai pic u 4 function, storage class and array and strings
PPT
Oracle Sql & PLSQL Complete guide
PPTX
STRING CLASS AND STRING BUFFER CLASS CONCEPTS IN JAVA
Introduction to oracle functions
string functions in SQL ujjwal matoliya.pptx
SQL select statement and functions
Python data handling
Regular expressions in oracle
Introduction to Oracle Functions--(SQL)--Abhishek Sharma
Key functions in_oracle_sql
python1uhaibueuhERADGAIUSAERUGHw9uSS.pdf
Chapter-5.ppt
Day5 String python language for btech.pptx
Bsc cs i pic u-4 function, storage class and array and strings
Diploma ii cfpc u-4 function, storage class and array and strings
strings in php how to use different data types in string
Functions torage class and array and strings-
Btech i pic u-4 function, storage class and array and strings
function, storage class and array and strings
Mcai pic u 4 function, storage class and array and strings
Oracle Sql & PLSQL Complete guide
STRING CLASS AND STRING BUFFER CLASS CONCEPTS IN JAVA
Ad

More from anjanasharma77573 (20)

PPTX
In- Built Math function in java script..
PPTX
In Built Math functions in java script..
PPTX
What is tidyverse in R languages and different packages
PPTX
basic of data science and big data......
PPTX
What is big data and 5'v of big data....
PPTX
Basic of data and different type of data
PPTX
What is Big Data , 5'v of BIG DATA and Challenges
PPTX
Basic of data science, and type of data.
PPTX
Role of Infogram, power bi and google charts
PPTX
DATA VISUALIZATION TOOLS e.g Power bi..
PPTX
type of vector data in vectors and geometries
PPTX
Introduction to vectors and geometry - ..
PPTX
type of vector data in vectors and geometry
PPTX
Introduction to vectors and geometry -....
PPTX
basic of SQL constraints in database management system
PPTX
SQL subqueries in database management system
PPTX
practices of C programming function concepts
PPTX
Practice of c PROGRAMMING logics and concepts
PPTX
programming concepts with c ++..........
PPTX
basic of c programming practicals.......
In- Built Math function in java script..
In Built Math functions in java script..
What is tidyverse in R languages and different packages
basic of data science and big data......
What is big data and 5'v of big data....
Basic of data and different type of data
What is Big Data , 5'v of BIG DATA and Challenges
Basic of data science, and type of data.
Role of Infogram, power bi and google charts
DATA VISUALIZATION TOOLS e.g Power bi..
type of vector data in vectors and geometries
Introduction to vectors and geometry - ..
type of vector data in vectors and geometry
Introduction to vectors and geometry -....
basic of SQL constraints in database management system
SQL subqueries in database management system
practices of C programming function concepts
Practice of c PROGRAMMING logics and concepts
programming concepts with c ++..........
basic of c programming practicals.......
Ad

Recently uploaded (20)

PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PPT
Miokarditis (Inflamasi pada Otot Jantung)
PDF
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
PPTX
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
PDF
.pdf is not working space design for the following data for the following dat...
PDF
Lecture1 pattern recognition............
PPTX
climate analysis of Dhaka ,Banglades.pptx
PDF
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PPTX
advance b rammar.pptxfdgdfgdfsgdfgsdgfdfgdfgsdfgdfgdfg
PDF
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
PPTX
Supervised vs unsupervised machine learning algorithms
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PPTX
IBA_Chapter_11_Slides_Final_Accessible.pptx
PPTX
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
PDF
Foundation of Data Science unit number two notes
PPT
Quality review (1)_presentation of this 21
PPTX
STUDY DESIGN details- Lt Col Maksud (21).pptx
Galatica Smart Energy Infrastructure Startup Pitch Deck
Miokarditis (Inflamasi pada Otot Jantung)
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
.pdf is not working space design for the following data for the following dat...
Lecture1 pattern recognition............
climate analysis of Dhaka ,Banglades.pptx
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
advance b rammar.pptxfdgdfgdfsgdfgsdgfdfgdfgsdfgdfgdfg
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
Supervised vs unsupervised machine learning algorithms
Acceptance and paychological effects of mandatory extra coach I classes.pptx
IBA_Chapter_11_Slides_Final_Accessible.pptx
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
Foundation of Data Science unit number two notes
Quality review (1)_presentation of this 21
STUDY DESIGN details- Lt Col Maksud (21).pptx

character function in database managemnet system

  • 1. Types There are two types of single-row character functions: Case-manipulation functions Character-manipulation functions Case-Manipulation Functions You use case-manipulation functions to change the case of character strings. The types of case-manipulation functions are LOWER , UPPER , and INITCAP . Character Functions
  • 2. Character-Manipulation Functions You use character-manipulation functions to manipulate character strings. The types of character-manipulation functions are CONCAT , SUBSTRING , LEFT , RIGHT , TRIM , and REPLACE . LOWER() function The SQL LOWER() function is used to convert all characters of a string to lower case. Syntax: LOWER(string) UPPER() function The SQL UPPER() function is used to convert all characters of a string to uppercase. Syntax: UPPER(string)
  • 3. INITCAP : This function converts alpha character values to uppercase for the first letter of each word and all others in lowercase. The words in the string is must be separated by either # or _ or space. INITCAP(SQL course) Character-Manipulative Functions CONCAT : This function always appends ( concatenates ) string2 to the end of string1. If either of the string is NULL, CONCAT function returns the non-NULL argument. If both strings are NULL, CONCAT returns NULL. Syntax: CONCAT('String1', 'String2')
  • 4. LENGTH : This function returns the length of the input string. If the input string is NULL, then LENGTH function returns NULL and not Zero. Also, if the input string contains extra spaces at the start, or in between or at the end of the string, then the LENGTH function includes the extra spaces too and returns the complete length of the string. Syntax: LENGTH(Column|Expression) SUBSTRING/SUBSTR : This function returns a portion of a string from a given start point to an end point. If a substring length is not given, then SUBSTR returns all the characters till the end of string (from the starting position specified). Syntax:SUBSTR('String',start-index,length_of_extracted_string)
  • 5. LEFT() •Definition: Extracts a specified number of characters from the left side of a string. •Syntax: LEFT(string, length) •Example: SELECT LEFT('hello world', 5) •Output: hello RIGHT() Definition: Extracts a specified number of characters from the right side of a string. Syntax: RIGHT(string, length) Example: SELECT RIGHT('hello world', 5) Output: world TRIM() Definition: Removes leading and trailing spaces from a string. Syntax: TRIM([LEADING | TRAILING | BOTH] trim_character FROM string) Example: SELECT TRIM(' hello world ') Output: hello world
  • 6. REPLACE : This function searches for a character string and, if found, replaces it with a given replacement string at all the occurrences of the string. REPLACE is useful for searching patterns of characters and then changing all instances of that pattern in a single function call. Syntax: REPLACE(Text, search_string, replacement_string)