exp 7 appended

Upload: abhinavmehan

Post on 30-May-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 Exp 7 Appended

    1/13

  • 8/9/2019 Exp 7 Appended

    2/13

  • 8/9/2019 Exp 7 Appended

    3/13

    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

    INSTRReturn the location of nth occurrence of string X in the string data , starting

    from positions. The syntax of the INSTRcommand is

    INSTR( DATA,X,S,N )

    For example

  • 8/9/2019 Exp 7 Appended

    4/13

    GREATESTIt returns the greatest value among all expression. The syntax of the

    greatestcommand is

    GREATEST (EXP1,EXP2,EXP3. )

    For example

    LEASTIt returns the least value among all expression. The syntax of the LEASTcommand is

    LEAST (EXP1,EXP2,EXP3. )

    For example

    NUMERIC FUNCTIONSNnumeric functions are those functions that accept valuesand after performing the required operation, return numeric values. Some useful numeric

    functions are

    ABSReturns the absolute value of data. The syntax of the ABS command is

    ABS( DATA )

  • 8/9/2019 Exp 7 Appended

    5/13

    For example

    CEILReturns 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

  • 8/9/2019 Exp 7 Appended

    6/13

  • 8/9/2019 Exp 7 Appended

    7/13

    POWER This function returns m raise to nth power. Returns value of argument mraised 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 POWERcommand 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 isROUND(n,m)

    For example

  • 8/9/2019 Exp 7 Appended

    8/13

  • 8/9/2019 Exp 7 Appended

    9/13

    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 ofthe count(*)command is

    COUNT(*)

    For example to count the number of students in particular trades from sturept table, wewill 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

  • 8/9/2019 Exp 7 Appended

    10/13

  • 8/9/2019 Exp 7 Appended

    11/13

    VARIANCE (X)

    For example

    STDDEV Used to find the standard deviation. The syntax of the STDDEV commandis

    STDDEV (X)

    For example

    DATE FUNCTIONSDate 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.

    ADD_MONTHSThis function adds number of months to a given date and returns adate after those many months.

    Returns the value of argument date d plus n months. The argument n can be any integer.If the last day of the resulting month. Otherwise, the result has the same day component

    as d. The syntax of the ADD_MONTHS command is

    ADD_MONTHS(d,n)

    For example

  • 8/9/2019 Exp 7 Appended

    12/13

    LAST_DAYThis function gives last day of the month specified in date.The syntax ofthe 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_DAYcommand is

    NEXT_DAY(d,char)

    For example

    MONTHS_BETWEENThis function finds out the number of months passed between

    given two dates. The syntax of the MONTHS_BETWEEN command is

    MONTHS_BETWEEN(date2,date1)

  • 8/9/2019 Exp 7 Appended

    13/13

    For example