0% found this document useful (0 votes)
13 views1 page

Lab 5 Tasks

DBMS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views1 page

Lab 5 Tasks

DBMS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DEPARTMENT OF COMPUTER SYSTEMS ENGINEERING

MEHRAN UNIVERSITY OF ENGINEERING & TECHNOLOGY, JAMSHORO


Database Systems
Lab Experiments

Consider following tables to write SQL queries.


EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO )
DEPT (DEPTNO, DNAME, LOC)

Lab 5: To use Single row functions in SQL queries.


1. Display the employee's name in upper case letters and their salary rounded to two
decimal places.
2. Display the employee name and their annual salary including commission amount. If
the commission is null replace it with 0.
3. Display Employee’s name with the first letter capitalized and all other letters lowercase
and the length of their name, for all employees whose name starts with J, A, or M. Give
each column appropriate names.
4. Display the name, hiredate, and day of the week on which the employee started. Label
the column First Day.
5. For each employee, display the employee name and calculate the number of months
between today and the date the employee was hired. Label the column
MONTHS_WORKED. Order the result by the number of months employed. Round the
number of months up to the closest whole number.
6. Display the Employee number, name, salary, and salary increase by 15% expressed as
a whole number. Label the column New Salary.
7. Display the employee name, hiredate, and salary review date, which is the first Monday
after six months of service. Label the column REVIEW. Format the dates to appear in
the format similar to “Sunday, the seventh of September, 1981”.

You might also like