exam questions

Exam 1z0-082 All Questions

View all questions & answers for the 1z0-082 exam

Exam 1z0-082 topic 1 question 4 discussion

Actual exam question from Oracle's 1z0-082
Question #: 4
Topic #: 1
[All 1z0-082 Questions]

Which two statements are true about date/time functions in a session where NLS_DATE_FORMAT is set to DD-MON-YYYY HH24:MI:SS? (Choose two.)

  • A. CURRENT_TIMESTAMP returns the same date and time as SYSDATE with additional details of fractional seconds
  • B. SYSDATE can be queried only from the DUAL table
  • C. CURRENT_DATE returns the current date and time as per the session time zone
  • D. SYSDATE can be used in expressions only if the default date format is DD-MON-RR
  • E. SYSDATE and CURRENT_DATE return the current date and time set for the operating system of the database server
  • F. CURRENT_TIMESTAMP returns the same date as CURRENT_DATE
Show Suggested Answer Hide Answer
Suggested Answer: CF 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Blob44
3 months, 4 weeks ago
Selected Answer: CF
CURRENT_DATE and CURRENT_TIMESTAMP are tied to session time zone SYSDATE is tied to database server date and time. It can be used querying any table, not just dual, no matter the session nls_date_format chosen
upvoted 1 times
...
nautil2
3 months, 4 weeks ago
Selected Answer: CF
A - false; it is the same only in case database server operating system uses the same time zone as the operating system of the database client (session time zone) B - false; can be queried in any table, e.g. SELECT emp_no,ename,salary,mgr_no,sysdate FROM emp; C - true; SQL> select sys_extract_utc(systimestamp) from dual; SYS_EXTRACT_UTC(SYSTIMESTAMP) --------------------------------------------------------------------------- 11.09.23 13:58:24,316896 SQL> SELECT SESSIONTIMEZONE FROM DUAL; SESSIONTIMEZONE --------------------------------------------------------------------------- +02:00 SQL> SELECT current_date FROM dual; CURRENT_DATE -------------------- 11-SEP-2023 15:58:41 D - false; sysdate can be used independently of the setting of the NLS_DATE_FORMAT E - false; sydate returns date and time of the operating system of the database server, current_date returns date and time in the session time zone (i.e. in the time zone of the client) F - true; both variables returns current time and date set in the session time zone
upvoted 2 times
...
feixiang
1 year, 5 months ago
I think C and E are correct, CURRENT_TIMESTAMP shows more content than current_date
upvoted 2 times
deaf52
10 months, 2 weeks ago
but not in smae time zone
upvoted 1 times
...
...
chandanchoudhary
1 year, 7 months ago
C & F are correct SQL> SQL> SELECT sessiontimezone FROM DUAL; SESSIONTIMEZONE --------------------------------------------------------------------------- +10:00 SQL> select current_date from dual; CURRENT_DATE ----------------------------- 31-MAY-2023 02:24:46 SQL> select CURRENT_TIMESTAMP from dual; CURRENT_TIMESTAMP --------------------------------------------------------------------------- 31-MAY-23 02.25.10.789980 AM +10:00 SQL> select SYSDATE from dual; SYSDATE ----------------------------- 30-MAY-2023 22:25:23 SQL> select CURRENT_DATE from dual; CURRENT_DATE ----------------------------- 31-MAY-2023 02:25:41 SQL> select CURRENT_TIMESTAMP from dual; CURRENT_TIMESTAMP --------------------------------------------------------------------------- 31-MAY-23 02.25.58.563965 AM +10:00 SQL> select sysdate from v$database; SYSDATE ----------------------------- 30-MAY-2023 22:26:58 SQL>
upvoted 3 times
...
Aramazd
2 years, 9 months ago
F cannot be correct: [oracle@localhost ~]$ cat date_format.sql alter session set NLS_DATE_FORMAT is set to 'DD-MON-YYYY HH24:MI:SS' ; select current_timestamp from dual ; select current_date from dual ; [oracle@localhost ~]$ sqlplus system/oracle @date_format.sql SQL*Plus: Release 19.0.0.0.0 - Production on Wed Apr 6 04:39:17 2022 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Last Successful login time: Wed Apr 06 2022 04:38:02 -04:00 Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 alter session set NLS_DATE_FORMAT is set to 'DD-MON-YYYY HH24:MI:SS' * ERROR at line 1: ORA-00927: missing equal sign CURRENT_TIMESTAMP --------------------------------------------------------------------------- 06-APR-22 04.39.18.153607 AM -04:00 CURRENT_D --------- 06-APR-22
upvoted 1 times
...
ryuah
3 years ago
C,F is correct
upvoted 2 times
...
eyildiz
3 years, 3 months ago
I think A and C are correct. SQL> ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS'; SQL> select sysdate,current_date,current_timestamp from dual; SYSDATE CURRENT_DATE CURRENT_TIMESTAMP -------------------- -------------------- --------------------------------------------------------------------------- 28-SEP-2021 14:32:48 28-SEP-2021 14:32:48 28-SEP-21 02.32.48.201457 PM +03:00 https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions172.htm https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions036.htm https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions037.htm
upvoted 3 times
DarrenChenSHCMB
3 years, 2 months ago
AC is correct
upvoted 1 times
...
j_tw
1 year, 9 months ago
A cannot be correct. Becasue your DB server and your session are in same region, current_date and sysdate are same. If you connect to your DB at another timezone, that command return another result. So....it can be same, but not always do.
upvoted 1 times
...
...
kawsar
3 years, 5 months ago
SQL> set serveroutput on SQL> declare 2 ld date; 3 begin 4 ld:=sysdate; 5 dbms_output.put_line(ld); 6 end; 7 / 08-AUG-2021 15:12:35
upvoted 2 times
...
kawsar
3 years, 5 months ago
ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS'; select current_timestamp from dual; select current_date from dual; select sysdate from dual; 08-AUG-21 02.00.13.303335 AM US/PACIFIC 08-AUG-2021 02:00:15 08-AUG-2021 09:00:17 Now check the answers!!!!
upvoted 2 times
...
ama
4 years, 5 months ago
so corrects are C , F
upvoted 3 times
...
ama
4 years, 5 months ago
E is also wrong becuase sysdate Displays only date
upvoted 1 times
danito
4 years, 5 months ago
if you read the question "where nls_date_format is set to ...." I have done this and this is the result: SQL> ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS'; Sesion modificada. SQL> select sysdate from dual; SYSDATE -------------------- 17-AGO-2020 17:59:34 SQL> select current_date from dual; CURRENT_DATE -------------------- 17-AGO-2020 17:59:53 maybe E is correct
upvoted 1 times
...
...
ama
4 years, 5 months ago
A is wrong becuase sysdate Displays only date but not the time.
upvoted 1 times
elvegaa
4 years, 2 months ago
SYSDATE also shows time if you change the date display format to include it. However, A is wrong because SYSDATE shows database resident OS date&time while CURRENT_TIMESTAMP shows session date&time. Different time zones can affect the result.
upvoted 2 times
...
...
you1234
4 years, 6 months ago
A is wrong because it displaying the fractional with timezone. hence its looks wrong.
upvoted 1 times
elvegaa
4 years, 2 months ago
Not because of this, but because SYSDATE shows database resident OS date&time while CURRENT_TIMESTAMP shows session date&time. Different time zones can affect the result.
upvoted 3 times
...
...
ama
4 years, 6 months ago
B is wrong, see below: SQL> select sysdate from v$instance; SYSDATE -------- 25.06.20
upvoted 4 times
NowOrNever
4 years, 6 months ago
but only works as sysdba !
upvoted 1 times
ama
4 years, 5 months ago
and ? it has Nothing to do with this question
upvoted 2 times
...
elvegaa
4 years, 2 months ago
It was just an example. You can use any table SYSDATE is a built-in SQL function available for all users. You can use it anywhere you can use it as any other built-in SQL function. Ex. insert into mytable values (..., sysdate, ...);
upvoted 2 times
...
...
...
danito
4 years, 7 months ago
I think C F
upvoted 3 times
danito
4 years, 7 months ago
Sorry A C https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions172.htm https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions037.htm
upvoted 1 times
elvegaa
4 years, 2 months ago
A is wrong. SYSDATE - returns the current date and time set for the operating system on which the database resides CURRENT_TIMESTAMP - returns the current date and time in the session time zone If you have a different time zone set in your session than the time zone set in the database's OS, time will be different
upvoted 1 times
...
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago