Which two SQL statements would give the required output?

You need to calculate the number of days from 1st Jan 2007 till date: Dates are stored in
the default format of dd-mm-rr. Which two SQL statements would give the required output?
(Choose two.)

You need to calculate the number of days from 1st Jan 2007 till date: Dates are stored in
the default format of dd-mm-rr. Which two SQL statements would give the required output?
(Choose two.)

A.
SELECT SYSDATE – TO_DATE(’01-JANUARY-2007′) FROM DUAL

B.
SELECT SYSDATE – ’01-JAN-2007′ FROM DUAL

C.
SELECT TO_DATE(SYSDATE,’DD/MONTH/YYYY’)-’01/JANUARY/2007′ FROM DUAL;

D.
SELECT SYSDATE – TO_DATE(’01/JANUARY/2007′) FROM DUAL;

E.
SELECT TO_CHAR(SYSDATE,’DD-MON-YYYY’)-’01-JAN-2007′ FROM DUAL;



Leave a Reply 5

Your email address will not be published. Required fields are marked *


luca

luca

All the queries produce an error.

kim

kim

Nop, A and D work fine

shivani Aggarwal

shivani Aggarwal

In order to convert given date to default date format we need to use to_date function and then subtract from sysdate….In To_date we are not giving any format so it convert to default format
hence A and D are correct.

Malcolm

Malcolm

Cleared Oracle Database 11g 1Z0-051 exam last weekend!

Scored 90%! (The passing score is 60%)

There were 64 questions in my actual 1Z0-051 test.

Many questions on SQL statements (Examine, Evaluate…etc.), Manipulating Data (Insert, Update, Delete), Using DDL Statements to Create and Manage Tables.

Also, please pay close attention to questions on Reporting Aggregated Data Using the Group Functions, Using Subqueries to Solve Queries, Creating Schema Objects, a little difficult!

I mainly learned the PassLeader 1Z0-051 dumps (http://www.passleader.com/1z0-051.html) (303q VCE and PDF), all questions were from it, and many wrong answers have been corrected in it, the most valid 1Z0-051 dumps! DO RECOMMEND!!

Malcolm

Malcolm

By the way, part of that 303q 1Z0-051 dumps are available here:

http://www.oraclebraindump.com/?s=1z0-051

(
p.s. More 1Z0-051 exam questions on Google Drive: drive.google.com/open?id=0B-ob6L_QjGLpWXpBUEhyRnVXVlE
)

Good Luck!!!