Explain the functions trim-length-count in oracle, Database Management System

Assignment Help:

Explain the following functions of Oracle with suitable examples:
(i) To_Char( ) (ii) Count( )
(iii) Trim( ) (iv) Length( )

Ans: (i) To_char( ): The TO_CHAR function converts a DATETIME, number, or NTEXT expression to a TEXT expression in a specified format. This function is typically used to format output data.

(ii) Count( ): The COUNT function returns the number of rows in a query.
The syntax for the COUNT function is:
SELECT COUNT (expression)
FROM tables
WHERE predicates;

(iii) Trim( ): In Oracle/PLSQL, the trim function removes all specified characters either from the beginning or the ending of a string.
The syntax for the trim function is:
trim( [ leading | trailing | both [ trim_character ] ] string1 )
leading - remove trim_string from the front of string1.
trailing - remove trim_string from the end of string1.
both - remove trim_string from the front and end of string1.

(iv) Length( ): In Oracle/PLSQL, the length function returns the length of the specified string.
The syntax for the length function is:
length(string1)
string1 is the string to return the length for. If string1 is NULL, then the function returns
NULL.


Related Discussions:- Explain the functions trim-length-count in oracle

Division operation, To do the division operation R1 ÷ R2, R2 should be a co...

To do the division operation R1 ÷ R2, R2 should be a correct subset of R1. In the following example R1 have attributes A and B and R2 have only attribute B so R2 is a correct subse

Data Warehousing Job Scheduling, 1) Define a job scheduling strategy that w...

1) Define a job scheduling strategy that will meet business requirement of reporting availability by 6am CST for the following cubes? Show the job scheduling dependencies in a pict

Explain about primary key, Explain about primary key Primary Key: It ...

Explain about primary key Primary Key: It is one of the candidate keys that are taken to be the recognizing key for the entire table. E.g. although there are two candidate ke

Define single value and multivalued attribute, Define Single Value and Mult...

Define Single Value and Multivalued attribute Single value attribute comprise a single atomic value for an entity and multivalued attribute may have much more than one value f

Calculate the joint probability, Consider the following frequency counts o...

Consider the following frequency counts of some itemsets in a transaction database r : freq({A}, r) = 0.405 freq({B}, r) = 0.510 freq({C}, r) = 0.303 freq({A

Describe integrity constraints, Describe integrity constraints? Integr...

Describe integrity constraints? Integrity Constraints - A database is just as excellent as the information stored in it, and a DBMS must therefore help avoid the entry of inc

Define sequence, Define Sequence A sequence is a set of integers 1, 2, ...

Define Sequence A sequence is a set of integers 1, 2, 3 that are generated in order on demand. Sequences are regularly used in databases because lots of applications require ev

What is horizontal fragmentation, What is horizontal fragmentation? Hor...

What is horizontal fragmentation? Horizontal fragmentation divides the relation by assuming every tuple of r to one or more fragments

What do you mean by correlated subquery, What do you mean by Correlated sub...

What do you mean by Correlated subquery? Subqueries, or nested queries, are used to bring back a set of rows to be used by the parent query. Depending on how the subquery is writ

List and describe the different types of indexes, Question 1 Indexes are o...

Question 1 Indexes are ocasionally defines on a single field of a file called an indexing field. List and describe the different types of indexes Question 2 Consider a book i

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd