Essay PreviewMore ↓
Each date represents the century, year, month, day, hours, minutes, and seconds.
The default date format is DD-MON-YY.
Using the SYSDATE function, you can display the current date and time.
You can use SYSDATE as you would use any other column name.
In order to view the time you will need to use the TO_CHAR function along with a
format mask which includes a time format element.
For example, you can display the current date by selecting SYSDATE from a table.
You usually select SYSDATE from a dummy table called DUAL.
All users can access the DUAL table.
It is owned by the SYS user.
It consists of one column known as DUMMY, and one row with the value X.
When you want to return a value - not necessarily a date - once only, the DUAL table
To display the current date using the DUAL table, you use the command shown.
And the output displays the current date.
Dates are stored as numbers in the database, which enables you to perform arithmetical
calculations on them.
You can add or subtract a number to or from a date for a resultant date value.
You can subtract one date from another to find the number of days between them.
You can also add hours to a date and time value.
This is performed by dividing the number of hours in the time value by 24.
Let's take a look at how you can manipulate dates.
Let's say that you want to add and subtract days from the current date.
To add one hundred days to the current date, you type the command shown.
The result is displayed in the column SYSDATE+100.
If you want to subtract 34 days from the current date, you type the command shown.
The result is displayed in the column SYSDATE-34.
Let's say you want to subtract the hire date from the current date - you type the
The result shows the number of days between the current date and the hire date.
Let's say you want to display dates in terms of weeks.
To show the number of weeks each employee in department 10 has worked, you first
subtract the hiredate from the current date.
Then you divide the result by seven.
You can use date functions in a similar way to number functions to operate on Oracle
The MONTHS_BETWEEN function finds the number of months between two dates.
The result is displayed as a numeric value.
This is the only date function that does not return a date value.
How to Cite this Page
"Oracle." 123HelpMe.com. 11 Dec 2019
Need Writing Help?
Get feedback on grammar, clarity, concision and logic instantly.Check your paper »
- Oracle Implementations Introduction .........................................................................................................................3 Project Manager Role........................................................................................................3 Client Project Manager....................................................................................................3 Consulting Project Manager ...........................................................................................3 Scope, Objectives and Approach..................................................................................4 Scope..................................................... [tags: Oracle Implementation Project Management Essays]
4787 words (13.7 pages)
- ... The Homeric myth is only one of the many parables that explain Delphi's origin, but the record of the Oracle's prophecies at Delphi have been slightly more concrete. Polytheism was practiced in ancient Greece. Apollo, the god of music, light, and order, was the son of Zeus. "The gods were considered all powerful, all controlling and all knowing" (Scott 9). The Oracle of Apollo was the most steadfast and consistent prognosticator in all of Greece. People would traverse over long distances and in some cases wait for months on end just to seek advice from the sibyl (Scott 9).... [tags: ancient Greek beliefs and prophecies]
1477 words (4.2 pages)
- Tibetan Oracles The miraculous feats of the Tibetan oracles are well known sources of mysticism. Stories of men who can bend metal swords with their bare hands, dance wildly and proclaim the future have piqued the curiosity and fascination of many. However, most rationale people will question, how real is the Tibet oracle. Are these men really visited by the deities who they claim to be visited by or are they merely masters of illusion. “The desire to know the future is probably as old as the human race.... [tags: Tibet Oracle Oracles Essays]
4919 words (14.1 pages)
- Financial Analysis of Oracle Corp INTRODUCTION Background and History Oracle Corporation is a technology company that supplies software for the use of information management. They develop, manufacture, market and distribute computer software that helps other corporations manage their data so they can better grow and prosper. In 1977, Larry Ellison, Bob Miner, and Ed Oates founded System Development Laboratories. After being inspired by a research paper written in 1970 by an IBM researcher titled “A Relational Model of Data for Large Shared Data Banks” they decided to build a new type of database called a relational database system.... [tags: essays papers]
2599 words (7.4 pages)
- Oracle- Database Management System Data management is an extraordinarily old craft. Aristotle's scheme of interlocking classifications of knowledge in his work Physica is a data-management effort. In the early 1800s the Jacquard loom used holes punched in paper cards to represent instructions for controlling the action of a loom. These cards became the basis for Herman Hollerith’s card-sorting device, used for the 1890 U.S. census http://80-gme.grolier.com.ezproxy.apollolibrary.com. Many database programs were designed around the physical cards: the maximum information that could be encoded on a punch card became the length of a standard record.... [tags: essays research papers]
2005 words (5.7 pages)
- Dates in Oracle are stored in numeric format. Each date represents the century, year, month, day, hours, minutes, and seconds. The default date format is DD-MON-YY. Using the SYSDATE function, you can display the current date and time. You can use SYSDATE as you would use any other column name. In order to view the time you will need to use the TO_CHAR function along with a format mask which includes a time format element. For example, you can display the current date by selecting SYSDATE from a table.... [tags: essays research papers]
961 words (2.7 pages)
- Oracle Products and Services A Brief Overview of the Oracle Product and Service Lines Oracle is one of the premier database and application providers in the Industry. With the support of developers world wide, Oracle offers cutting edge technology in both the public and private sectors. Oracle has taken on many of its partners and today competes with some of the biggest names in the industry, such as: Computer Associates with the Ingres database IBM with DB/2 database Informix with the Informix database Microsoft with Access and SQL Server database Software AG with ADABAS PostgressSQL (free open source database) With all these differen... [tags: Papers]
450 words (1.3 pages)
- For this week’s paper I have chosen to do a comparison between IBM’s DB2 database management system (DBMS) product and Oracle. Realistically, making such a comparison is akin to discussing religion with friends. Each person will have their own biases based on their own experiences. Looking for an unbiased opinion is much like looking for the Holy Grail, every bit as speculative and subjective with the results jaundiced by the outlook of the reporter (Lim, 2002). A decision between DB2 and Oracle should be based on what resources are available for use at the site.... [tags: essays research papers]
1185 words (3.4 pages)
- Oracle in Greek Religion oracle in Greek religion, priest or priestess who imparted the response of a god to a human questioner. The word is also used to refer to the response itself and to the shrine of a god. Every oracular shrine had a fixed method of divination. Many observed signs, such as the motion of objects dropped into a spring, the movement of birds, or the rustle of leaves. Often dreams were interpreted. A later and popular method involved the use of entranced persons whose ecstatic cries were interpreted by trained attendants.... [tags: Papers]
773 words (2.2 pages)
- Oracle Databases A new energy is rising within CNS. Over the past year, many members of our administrative computing team have been developing Oracle applications. It is a new challenge to both CNS and our clients. We journey up the learning curve together and over the trial-and-error hurdles. Each day offers a new opportunity to understand another concept or process. Some faculties and departments are already using Oracle applications in their day-to-day operations. As time goes by, more and more information users will be working with an application based on Oracle database technology.... [tags: Papers]
1555 words (4.4 pages)
The syntax for MONTHS_BETWEEN is shown - date1 and date2 are the dates that you
want to find the number of months between.
The result displayed can be either positive or negative.
If date1 is later than date2, the result is positive.
And if date1 is earlier than date2, the result is negative.
The ADD_MONTHS function adds to a particular date the number of calendar months
You need to supply a whole number for the number of months you want to add.
You can specify a negative number.
The syntax for ADD_MONTHS is shown.
The n in the syntax is the number of calendar months that you want to add to the
The value for n must be an integer, and it may be negative.
The NEXT_DAY function identifies the date of the next specified day of the week.
The syntax is as shown here.
Char in the syntax may be a number representing a day, or a character string.
The days are numbered one to seven, starting with Sunday.
The LAST_DAY function identifies the date of the last day of the specified month.
The syntax for LAST_DAY is shown.
The ROUND date function returns the date rounded to the nearest date of the unit
For example the month or year.
If you do not specify a unit, the date is rounded to the nearest day.
The syntax for ROUND is shown.
The fmt in the syntax is used to represent the format you want to round the date
The TRUNC function returns the date, truncated to the nearest date of the unit you
If you do not specify a unit, the date is truncated to the nearest day.
The syntax for TRUNC is shown here.
The ROUND and TRUNC date functions operate in a similar manner to their number function
Let's take a look at some examples of date functions.
Suppose employees are reviewed annually, based on their hiredate.
You can use date functions to calculate the next review date for employees.
To simplify the SELECT statements to follow, let's create a substitution variable
review that calculates the review date.
For more information on substitution variables, see the CBT Systems course "Oracle
Introduction: Subqueries, Reports, and DML".
Let's say you want to find the first Friday after the review date.
You use the NEXT_DAY function to do this.
And you can display the last day of the month in which the review date occurs using
the LAST_DAY date function.
Let's say you want to search for the date six months after the review date.
You use the ADD_MONTHS function to do this.
And you can use the MONTHS_BETWEEN function to find the number of months between
today and the review date for this year.
If the review date is later than today, the value is negative.
If it's earlier, it's positive.
If the current date is 17-Jun-98, and you want to round the current date to the
nearest month, you can use this command.
And to truncate the current date you can use this command.
Here you can compare the effects of TRUNC and ROUND with the current date.