PRACTICAL ASSIGNMENT – 8.
Table Name: EMPLOYEE_DETAILS
Solve the following SQL Queries.
Write a query in SQL to list the employees with Hire date in the format like February 22,
1
1991.
2 Write a query in SQL to list the employees who joined before 1991
Write a query in SQL to display all the details of the employees whose commission is more
3
than their salary
4 Write a query in SQL to list the employees who joined in the month January
5 Write a query in SQL to list the employees who have joined in the year 1991
Write a query in SQL to list the name, id, hire_date, and salary of all the employees joined
6
before 1 Apr 91.
Write a query in SQL to list the employees who are retiring after 31-Dec-99 after completion
7
of 8 years of service period.
8 Write a query in SQL to list those employees whose salary is an odd value
9 Write a query in SQL to list those employees whose salary contain only 3 digits
10 Write a query in SQL to list the employees who joined in the month of APRIL
11 Write a query in SQL to list the employees who joined in company before 19th of the month.
Write a query in SQL to list the employees of department id 3001 or 1001 joined in the year
12
1991.
13 Write a query in SQL to list the employees who joined in any year except the month February
Write a query in SQL to list the employees who have joined on the following dates 1st May,
14
20th Feb, and 03rd Dec in the year 1991.
PRACTICAL ASSIGNMENT – 8.2
Refer Table EMPLYEE_DETAILS from ASSIGNMENT-7 and write the following SQL Queries:
Display the name of employees and check if HIRE_DATE is ’10-APR-97’ then assign as
1
“New Joinees”, else assign ‘EMPLOYEE’
2 Display ‘ANNUAL SALARY’ with mentioned annual commission of employees
Display employee name and total number of months between their joining date with ‘01-Jan-
3
98’
4. Display SYSDATE with 4 consecutive months from table DUAL.
Display name of the employees with ‘EMPLOYEE OF THE DAY’ whose total months=84
5.
between their joining date to ‘01-Jan-98’ else assign ‘GO ON’
Display employee names whose joining month is December assign with ‘VERY COLD’ else
6.
‘ENJOY’.
7. Display the Last Day of SYSDATE including the Next Day of the Last Day.
Execute the following query:
SELECT SYSDATE, NEXT_DAY(SYSDATE,'MONDAY') "Next Mon",
8.
NEXT_DAY(SYSDATE,'FRIDAY') "Next Fri",
NEXT_DAY(LAST_DAY(SYSDATE)+1,'TUESDAY') "First Tue” FROM dual;