Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Oracle9i: SQL1 Selected Single-Row Functions.

Similar presentations


Presentation on theme: "Introduction to Oracle9i: SQL1 Selected Single-Row Functions."— Presentation transcript:

1 Introduction to Oracle9i: SQL1 Selected Single-Row Functions

2 Introduction to Oracle9i: SQL2 Chapter Objectives Use the UPPER, LOWER, and INITCAP functions to change the case of field values and character strings Extract a substring using the SUBSTR function Determine the length of a character string using the LENGTH function

3 Introduction to Oracle9i: SQL3 Chapter Objectives Use the LPAD and RPAD functions to pad a string to a desired width Use the LTRIM and RTRIM functions to remove specific characters strings Round and truncate numeric data using the ROUND and TRUNC functions Calculate the number of months between two dates using the MONTHS_BETWEEN function

4 Introduction to Oracle9i: SQL4 Chapter Objectives Identify and correct problems associated with calculations involving null values using the NVL function Display dates and numbers in a specific format with the TO_CHAR function Determine the current date setting using the SYSDATE keyword Nest functions inside other functions Identify when to use the DUAL table

5 Introduction to Oracle9i: SQL5 Terminology Function – predefined block of code that accepts arguments Single-row Function – returns one row of results for each record processed Multiple-row Function – returns one result per group of data processed

6 Introduction to Oracle9i: SQL6 Types of Functions

7 Introduction to Oracle9i: SQL7 Case Conversion Functions Alter the case of data stored in a column or character string

8 Introduction to Oracle9i: SQL8 LOWER Function Used to convert characters to lower-case letters

9 Introduction to Oracle9i: SQL9 UPPER Function Used to convert characters to upper-case letters

10 Introduction to Oracle9i: SQL10 INITCAP Function Used to convert characters to mixed-case

11 Introduction to Oracle9i: SQL11 Character Manipulation Functions Manipulates data by extracting substrings, counting number of characters, replacing strings, etc.

12 Introduction to Oracle9i: SQL12 SUBSTR Function Used to return a substring, or portion of a string

13 Introduction to Oracle9i: SQL13 LENGTH Function Used to determine the number of characters in a string

14 Introduction to Oracle9i: SQL14 LPAD and RPAD Functions Used to pad, or fill in, a character string to a fixed width

15 Introduction to Oracle9i: SQL15 LTRIM and RTRIM Functions Used to remove a specific string of characters

16 Introduction to Oracle9i: SQL16 REPLACE Function Substitutes a string with another specified string

17 Introduction to Oracle9i: SQL17 CONCAT Function Used to concatenate two character strings

18 Introduction to Oracle9i: SQL18 Number Functions Allows for manipulation of numeric data

19 Introduction to Oracle9i: SQL19 ROUND Function Used to round numeric columns to a stated precision

20 Introduction to Oracle9i: SQL20 TRUNC Function Used to truncate a numeric value to a specific position

21 Introduction to Oracle9i: SQL21 Date Functions Used to perform date calculations or format date values

22 Introduction to Oracle9i: SQL22 MONTHS _ BETWEEN Function Determines the number of months between two dates

23 Introduction to Oracle9i: SQL23 ADD _ MONTHS Function Adds a specified number of months to a date

24 Introduction to Oracle9i: SQL24 NEXT _ DAY Function Determines the next occurrence of a specified day of the week after a given date

25 Introduction to Oracle9i: SQL25 TO _ DATE Function Converts various date formats to the internal format (DD-MON-YYYY) used by Oracle9i

26 Introduction to Oracle9i: SQL26 Format Model Elements - Dates

27 Introduction to Oracle9i: SQL27 NVL Function Substitutes a value for a NULL value

28 Introduction to Oracle9i: SQL28 NVL2 Function Allows different actions based on whether a value is NULL

29 Introduction to Oracle9i: SQL29 TO_CHAR Function// Converts dates and numbers to a formatted character string

30 Introduction to Oracle9i: SQL30 Format Model Elements – Time and Number

31 Introduction to Oracle9i: SQL31 Other Functions NVL NVL2 TO_CHAR DECODE SOUNDEX

32 Introduction to Oracle9i: SQL32 DECODE Function Determines action based upon values in a list

33 Introduction to Oracle9i: SQL33 SOUNDEX Function References phonetic representation of words

34 Introduction to Oracle9i: SQL34 Nesting Functions One function is used as an argument inside another function Must include all arguments for each function Inner function is resolved first, then outer function

35 Introduction to Oracle9i: SQL35 DUAL Table Dummy table Consists of one column and one row Can be used for table reference in the FROM clause


Download ppt "Introduction to Oracle9i: SQL1 Selected Single-Row Functions."

Similar presentations


Ads by Google