0% found this document useful (0 votes)
11 views9 pages

DB Lab 10

The document outlines a series of lab tasks for a Database Management System course, specifically for BS-SE 4th Semester students. It includes SQL queries that involve displaying employee information, calculating salaries, formatting outputs, and manipulating date data. The tasks require various SQL operations such as selection, formatting, and sorting of employee records.

Uploaded by

Ch Gulfam
Copyright
© © All Rights Reserved
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
0% found this document useful (0 votes)
11 views9 pages

DB Lab 10

The document outlines a series of lab tasks for a Database Management System course, specifically for BS-SE 4th Semester students. It includes SQL queries that involve displaying employee information, calculating salaries, formatting outputs, and manipulating date data. The tasks require various SQL operations such as selection, formatting, and sorting of employee records.

Uploaded by

Ch Gulfam
Copyright
© © All Rights Reserved
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/ 9

Database Management System

Department: BS-SE 4th Sem


Lab # 10

Submitted by:

Ahmed Mehmood RCF30145

Submitted to:

Mam Sehrish Ferdous


LAB TASKS

1. Write a query to display the current date.

2. For each employee, display the employee ID number, employee name, salary and salary
increased by 15% and expressed as whole number. Label the column NewSalary.

3. Modify the above query to add a column that subtracts the old salary from the new
salary. Label the Column Increase
4. Write a query that displays the employee’s names with the first letter capitalize and all
other letters lowercase and length of the names, for all employees whose name start with J,
A or M. Give each column an appropriate label. Sort the results by employees’ name.

5. For each employee, display the employee name and calculate the number of months
between today and a day the employee was hired. Label the column MONTHS_WORKED.
Order your results by the number of months employed. Round the number of results up
to closest whole number.
6. Write a query that produces the following for each employee:
a. <Employee name> earns <salary >monthly but wants<3 times salary>. Label
the column Dream Salaries.
b. //Salary should be in this format $99,999.00
7. Create a query to display the employee name and salary of all employees. Format the
salary to be 15 characters long, left-padded with $. Label the column SALARY.

8. Display each 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 similar to
“Monday, the Thirty-first of July, 2000”.
9. Display the employee name, hiredate, and day of the week on which the employee
started. Label the column DAY. Order the results by the day started with Monday.
10. Create a query that displays the employees’ names and indicates the amounts of their salaries
through asterisks. Each asterisk signifies a hundred dollars. Sort the data in descending order of
salary. Label the column EMPLOYEE_AND_THEIR_SALARIES.

You might also like