Date: 4-12-2013 Database System Lab 3-BCSF11 (Afternoon) : Instructions
Date: 4-12-2013 Database System Lab 3-BCSF11 (Afternoon) : Instructions
Date: 4-12-2013
Database System
Lab 3-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. Create a query that display the following format without using pipes
My Name Is SMITH And I am a CLERK In Department 30
2. Display the employees hire date in this format
e.g. if hiredate=21-AUG-81 then display it as
Twenty one August nineteen eighty-one
3. Write a query that display the name of those employees who dont
have a manager
e.g.
Name
MANAGER
Fakhar
No Manager
4. Write a query that display data of emp and dept table using join.
5. 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.
Section II
Database
REVERSE
SMITH
HTIMS
2. Display each employee s 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.
3. Create a query that displays the name of the employee and the
concat the number of asterisk according to the name of the
employee s length. E.g.
ENAME + ASTERISK
Database
SMITH *****
FAKHAR ******
4. Create a query that display s the employee s name and indicate
the amount of their annual salaries 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.
5. Write a query that display name and department name and manager
name of hose employee who have the same manager
6. 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
D
v. MANAGER
7. Write a query to display the name, department number and
department name for all employee s
8. Write a query that display the name of the employee and its
colleague name who work in the same department
9. Create a query that display the name of those employees who was
hired after SMITH .
10.