w3resource

Oracle: List the employees who are joined in the year between '01-Jan-2004' and '31-Dec-2008'

Oracle Operator: Exercise-14 with Solution

Write a query to list the employees who are joined in the year between '01-Jan-2004' and '31-Dec-2008'.

Sample table : employees


Sample Solution:

Oracle Code:

SELECT * 
FROM employees 
WHERE HIRE_DATE between ’01-jan-2004’ and ’31-dec-2008’;

Output:

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE  JOB_ID     SALARY    COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- -------------
        101 Neena                Kochhar                   NKOCHHAR                  515.123.4568         21-SEP-05 AD_VP       17000                       100            90                                                                                                                           
        103 Alexander            Hunold                    AHUNOLD                   590.423.4567         03-JAN-06 IT_PROG      9000                       102            60                                                                                                                           
        104 Bruce                Ernst                     BERNST                    590.423.4568         21-MAY-07 IT_PROG      6000                       103            60                                                                                                                           
        105 David                Austin                    DAUSTIN                   590.423.4569         25-JUN-05 IT_PROG      4800                       103            60                                                                                                                           
        106 Valli                Pataballa                 VPATABAL                  590.423.4560         05-FEB-06 IT_PROG      4800                       103            60                                                                                                                           
        107 Diana                Lorentz                   DLORENTZ                  590.423.5567         07-FEB-07 IT_PROG      4200                       103            60                                                                                                                           
.......

93 rows selected.

Pictorial Presentation:

Pictorial: List the employees who are joined in the year between '01-Jan-2004' and '31-Dec-2008'

Improve this sample solution and post your code through Disqus.

Previous: Write a query to concatenate first name, last name and job id from employees table in the following format.
Next: Oracle Wildcard special Operators

What is the difficulty level of this exercise?



Follow us on Facebook and Twitter for latest update.