Date Data types for Oracle

Source: Internet
Author: User
Tags local time time interval

Given below is a list of datetime data types and examples of

Values stored in them into a random order:

Datatype Example

1) INTERVAL year to MONTH a) ' 20030415 8:00:00 8:00 '

2) Timestampwith local time ZONE b) ' +06 03:30:16.000000 '

3) TIMESTAMP with time ZONE c) ' 17jun03 12.00.00.000000AM '

4) INTERVAL day to SECOND D) ' +0200 '

Identify the option that correctly matches the data types with the values.

A. 1d, 2c, 3a, 4b

B. 1b, 2a, 3c, 4d

C. 1b, 2a, 3d, 4c

D. 1d, 2c, 3b, 4a

Answer:a

In 047 of the questions above there is such a topic on date data types, like INTERVAL year to month,timestampwith the local time Zone,timestamp with time zone,interval days to S Econd is not used very much, these date data types are not very familiar with, the following to do some introduction to these data

Date: This is a 7-byte fixed-width date/time data type. The total contains 7 attributes, including the year, the century, the month, the day, the hour, the minute, and the second of the month.

TIMESTAMP: This is a fixed-width date/Time data type of 7 bytes or 12 bytes. It differs from the date data type because timestamp can contain decimal seconds (fractional second), and timestamp with decimal seconds can retain up to 9 digits to the right of the decimal point.

TIMESTAMP with time ZONE: Similar to the previous type, this is a fixed-width TIMESTAMP of 12 bytes, but it also provides timezone support. Additional information about the time zone is stored with timestamp in the data, so the previously inserted zone is retained with the data.

TIMESTAMP with the local time ZONE: Similar to TIMESTAMP, this is a fixed-width date/Time data type of 7-byte or 12-byte; If there is a modification in the database, the time ZONE provided in the data is referenced and normalized according to the database time zone for the date/times portion of the data. So, if you want to insert a date/time using the u.s./pacific time zone, and the database time zone is U.s./eastern, the last Date/time information is converted to the Eastern Time zone's date/time and stored like timestamp. When this data is obtained, the timestamp stored in the database is converted to the time of the session timezone.

INTERVAL year to MONTH: This is a 5-byte fixed-width data type that stores a time period, which stores the period as the number of years and months. You can use this time interval in a date operation to increase or decrease the type of a date or timestamp for a period of time.

INTERVAL Day to SECOND: This is a 12-byte fixed-width data type that is used to store a period of time, which stores a period of time in days/hours/minutes/seconds, and can have a maximum of 9 decimal seconds.

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.