Академический Документы
Профессиональный Документы
Культура Документы
UPPER Takes a string and converts any letters in it to uppercase.The return data has
the same data type as the argument char. The syntax of the UPPER command is
UPPER(char)
For example, to change the all the values to uppercase letter in the column ‘name’
For example
For example
LENGTH(char)this function returns the length of the given string.
it returns the length of parameter specified by argument char in characters.
If argument char has datatype char, the length includes all the trailing blanks.
If argument char is null, this function returns null. The syntax of the LENGTH
command is
LENGTH(char)
For example
INSTR Return the location of nth occurrence of string X in the string data , starting
from positions. The syntax of the INSTR command is
INSTR( DATA,X,S,N )
For example
GREATEST It returns the greatest value among all expression. The syntax of the
greatest command is
GREATEST (EXP1,EXP2,EXP3…. )
For example
LEASTIt returns the least value among all expression. The syntax of the LEAST
command is
LEAST (EXP1,EXP2,EXP3…. )
For example
ABSReturns the absolute value of data. The syntax of the ABS command is
ABS( DATA )
For example
CEIL Returns the smallest integer greater than or equal to data. The syntax of the ceil
command is
CEIL( DATA )
For example
FLOORReturns the largest integer greater than or equal to data. The syntax of the
floor command is
FLOOR ( DATA )
For example
LN Returns the natural logarithm of data. The syntax of the LN command is
LN ( DATA )
For example
LOG Returns the logarithm of the data to the base B. The syntax of the LOG
command is
LOG ( B,DATA )
For example
MOD This functions returns modulus(i.e., remainder) of given two numbers. Returns
remainder of argument m divided by argument n. Returns x m if n is 0 i.e., if
denominator is o. The syntax of the MOD command is
MOD(m,n)
For example
POWER This function returns m raise to nth power. Returns value of argument m
raised to nth power. The base m and the exponent n can be any numbers, but if m is
negative, n must be an integer. The syntax of the POWER command is
POWER(m,n)
For example
ROUND This function returns a number rounded off as per given specifications.
Returns value of argument n rounded to m places right of the decimal point; if m is
omitted to 0 place,m can be negative to round off digits left of the decimal point. M must
be an integer. The syntax of the ROUND command is
ROUND(n,m)
For example
SQRT This function returns the square root of the given number. Returns square root
of argument n. The value n cannot be negative. SQRT returns a “real” result. The syntax
of the SQRT command is
SQRT(n)
For example
TRUNC This function returns a number with some digits truncated. Returns value of
argument n truncated to argument m decimal places. If argument m is omitted to 0 places,
m can be negative to truncate (i.e., make zero) m digits left of the decimal point. The
syntax of the TRUNC command is
TRUNC(m,n)
For example
AGGREGATE FUNCTIONS The summary values are calculated from the data in a
particular column using SQL’s aggregate functions. Aggregate functions can be applied
to all rows in a table or to a subset of the table specified by a WHERE clause. These
functions are statistical functions. They are used to compute a single value from a set of
attribute values of a column. It is used to provide summarization information for a SQL
statement, such as totals, averages etc. Some aggregate functions are
COUNT() Used to count rows or values of a column that do not contain a NULL
value. The syntax of the COUNT command is
COUNT(X)
For example to count the number of cities, the different members belong to, we use the
following command
COUNT(*) Used to count all the rows of a table including duplicates. The syntax of
the count(*) command is
COUNT(*)
For example to count the number of students in particular trades from sturept table, we
will use the following command
SUM( ) Used to return a total or sum on the values of a numeric column for a group of
rows. The syntax of the SUM command is
SUM (X)
For example
AVG( ) Used to find averages for a group of rows. The syntax of the AVG command
is
AVG (X)
For example
MAX( ) Used to return the maximum value for the values of a column in a group of
rows. The syntax of the MAX command is
MAX (X)
For example
MIN( ) Used to return the minimum value for the values of a column in a group of
rows. The syntax of the MIN command is
MIN (X)
For example.
VARIANCE Used to compute the variance of values in columns. The syntax of the
variance command is
VARIANCE (X)
For example
STDDEV Used to find the standard deviation. The syntax of the STDDEV command
is
STDDEV (X)
For example
DATE FUNCTIONS
Date functions operate on values of the DATE data type. All function return a value of
DATE data type, except the MONTHS_BETWEEN function, which returns a number.
For example
LAST_DAYThis function gives last day of the month specified in date.The syntax of
the last_day command is
LAST_DAY(d)
For example
NEXT_DAYThis function returns the date of a specified coming day in the next week.
Returns the date of the first weekday named by argument char that is later than the date
d.the argument char must be a day of the week. The return value has the same hours,
minutes, and seconds component as the argument d. The syntax of the NEXT_DAY
command is
NEXT_DAY(d,char)
For example
For example