We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
Database Systems
MCS F19 Morning
LAB 3 1. Write a query to display ename, hiredate and experience in years. 2. LIST ALL RECORDS AS FOLLOWS. SMITH IS CLERK AND HE IS WORKING IN DEPT NO 20 SINCE 12-MAR-1981. 3. DISPLAY ENAME, JOB, SAL AND REVISED SAL AGAINST EACH EMPLOYEE. THE REVISED SAL IS BASED ON DEPTNO. THE SAL IS REVISED USING DEPTNO% I.e FOR DEPTNO 10, SAL IS INCREMENTED BY 10% AND SO ON. (USE DECODE FUNCTION) 4. USE DECODE FUNCTION TO DISPLAY ENAME, DNAME FOR ALL THE EMPLOYEES. SEE DNAME FROM DEPT TABLE. 5. SUPPOSE THAT ALL THE EMPLOYEES WERE HIRED ON 6 MONTHS PROBATION PERIOD. LIST THE HIREDATE AND LAST DATE OF PROBATION FOR EACH EMPLOYEE. 6. USE NVL2 FUNCTION TO DISPLAY NET SAL OF EACH EMPLOYEE CONSISTING OF SAL + COMM. 7. LIST ALL EMPLOYEES HIRED IN THE YEAR 1982.(Hint: You can use extract function for this query) 8. FIND THE DAY OF ALL EMPLOYEES WHEN THEY WERE HIRED. 9. FIND THE MONTHS OF SERVICE OF EACH EMPLOYEE. 10. LIST ALL EMPLOYEES WHOSE NAME STARTED WITH CHARACTER 'B' AND THEIR JOBS ARE MANAGER. 11. LIST OF THOSE EMPLOYEES, HAVING ONLY 4 CHARACTER LONG NAME AND JOB AS A 'SALESMAN’. 12. DISPLAY THE YEAR ONLY FROM THE HIREDATE. 13. FIND THE TEN PERCENT OF 'MANAGER' SALARY. 14. Write a query to display the no. Of months an employee has worked from his hiring. Round off the no. Of months. 15. Display each employee’s name, hire date, and salary review date, which is the first Monday after seven months of service. Label the column review. 16. Write a query to display the next Thursday of the month. 17. Write a query to display employees name and salary of all employees. Format the salary to be 15 characters long. Left padded with $. Label the column salary. 18. For all employees with job title of CLERK, calculate the remainder of the salary after it is divided by 5000. 19. Display the name and hire date of every employee who was not hired in 1981. 20. Write a query to add 10% increment for the employees who are working as Salesman, 15% for Clerk and 20% for those who are working as Manager. Rest of the employees’ salary will remain unchanged. 21. Display the names and department no. Of all employees who are in department no. 20 or 50 in alphabetical order by name.