0% found this document useful (0 votes)
43 views

Date: 4-12-2013 Database System Lab 3-BCSF11 (Afternoon) : Instructions

The document provides instructions for a database lab assignment. Students are to work individually and complete 10 tasks involving writing SQL queries to retrieve and format data from database tables. The tasks include displaying employee names with additional text, formatting date fields, retrieving employee records without managers, performing joins, concatenating text with field values, reversing strings, calculating dates, representing values as asterisks, sorting by salary, using the DECODE function to retrieve grades based on jobs, and more. Plagiarism is strictly prohibited and will result in failure of the lab.

Uploaded by

bilo044
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

Date: 4-12-2013 Database System Lab 3-BCSF11 (Afternoon) : Instructions

The document provides instructions for a database lab assignment. Students are to work individually and complete 10 tasks involving writing SQL queries to retrieve and format data from database tables. The tasks include displaying employee names with additional text, formatting date fields, retrieving employee records without managers, performing joins, concatenating text with field values, reversing strings, calculating dates, representing values as asterisks, sorting by salary, using the DECODE function to retrieve grades based on jobs, and more. Plagiarism is strictly prohibited and will result in failure of the lab.

Uploaded by

bilo044
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Database

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

Punjab University College Of Information and Technology (PUCIT)

Database

1. Write a query that displays the name of the employee in reverse .


name the column REVERSE. Only do for the name whose
length is 5
e.g.
ENAME

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

Punjab University College Of Information and Technology (PUCIT)

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.

Create a query that display pattern like

SMITH IS AN EMPLOYEE AND ITS MANAGER NAME'S IS KING

Instructor: Fakhra Jabeen

Punjab University College Of Information and Technology (PUCIT)

You might also like