You are on page 1of 2

Database

Date: 27-11-2013
Database System
Lab 2-BCSF11 (Afternoon)

Instructions:
Work on this lab individually. Discussion is not allowed.
Evaluation of tasks will be conducted in lab.
Anyone caught being indulged in the act of plagiarism would be awarded
an F grade in this lab.
Perform the following Tasks:
Section I
1. List name and salary of all the employees whose salary is not between 5000 to 10,000.
2. Display the name job and hire date of all the employees who are hired between
February 20, 1998 and May 1, 1998.
3. Display the name and depart number of all the employees who are in department 20
and 50 in alphabetically order.
4. Write a query to display the current date. Label the column Date.
5. List the name and hire date of all employees who was hired in 1996.
6. Display the name and job of all employees who dont have a manager.
7. List the name and commission of all employees who earn commission.
8. List the name of all employees who have an a or e in their name.
9. List the name of all employees who have an a in their name in the third place.
10. Display the last name and hire date of every employee who was hired in 1994.

Section II
1. For each employee display the name and number of months between today and the
date of employee was hired. Label the column Month Worked. Display the result in
ascending order.
2. Show the names of all employees together with the number of years and the number of
completed months that they have been employed.

Punjab University College Of Information and Technology (PUCIT)

Database

3. List the name, job and salary of all employees whose job is salesman or clerk and
whose salary is not equal to 2000, 3000, 7500.
4. Write a query that displays the employee numbers and names of all employees who work
in department 30 with any employee whose name contains a U.
5. Create a query to display the employee numbers and names of all employees who earn
more than the average salary. Sort the results in ascending order of salary.
6. Create a query that displays the employees name and commission amounts. If an
Employee does not earn commission; put No Commission. Label the column COMM.
7. Display the last name; hire date, and day of the week on which the employee started. Label
The column DAY. Order the results by the day of the week starting with Monday.

8. Display each employees name, hire date, 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 Monday, the Thirty-First of July, 2000.
9. Using the DECODE function, write a query that displays the grade of all employees based on
the
a. value of the column JOB_ID, as per the following data:
i. JOB
GRADE
ii. SALESMAN
A
iii. CLERK
B
iv. ANALYST
C
v. MANAGER
D

10. Create a query that displays the employees name and indicate the amount of their
annual saleries in term of asterisk *. Each asterisk signifies a thousand dollars. Sort
the data in descending order according to the salary. Label the column
EMPLOYEE_AND THEIR_SALARY.

Instructor: Fakhra Jabeen

Punjab University College Of Information and Technology (PUCIT)

You might also like