nerdexam
Oracle

1Z0-007 · Question #173

The EMP table has these columns: Management wants a list of names of employees who have been with the company for more than five years. Which SQL statement displays the required results?

The correct answer is C. SELECT ENAME. Expression SYSDATE-HIRE_DATE will show number of days after date of hiring employee, so you need to divide result of expression on 365 and this compare result with 5. Incorrect Answers A: This query returns all employees who were hired more than 5 days ago. B: This query will…

Restricting and Sorting Data

Question

The EMP table has these columns:

Management wants a list of names of employees who have been with the company for more than five years. Which SQL statement displays the required results?

Options

  • ASELECT ENAME
  • BSELECT ENAME
  • CSELECT ENAME
  • DSELECT ENAME

How the community answered

(44 responses)
  • A
    14% (6)
  • B
    2% (1)
  • C
    77% (34)
  • D
    7% (3)

Explanation

Expression SYSDATE-HIRE_DATE will show number of days after date of hiring employee, so you need to divide result of expression on 365 and this compare result with 5. Incorrect Answers A: This query returns all employees who were hired more than 5 days ago. B: This query will not return any record because result of HIRE_DATE-SYSDATE expression will be negative number. D: You need to divide, not to multiply, SYSDATE-HIRE_DATE on the number of days in 1 year.

Topics

#WHERE clause#date arithmetic#SYSDATE#filtering rows

Community Discussion

No community discussion yet for this question.

Full 1Z0-007 Practice