KEMBAR78
Employee Salary Queries Guide | PDF
0% found this document useful (0 votes)
36 views5 pages

Employee Salary Queries Guide

The document contains 9 tasks related to writing SQL queries to retrieve and display employee data from a database. The tasks include displaying the current date, calculating salary increases, formatting names, calculating months employed, formatting salaries, calculating review dates, and indicating salaries with asterisks.

Uploaded by

Aaiza Nadeem
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)
36 views5 pages

Employee Salary Queries Guide

The document contains 9 tasks related to writing SQL queries to retrieve and display employee data from a database. The tasks include displaying the current date, calculating salary increases, formatting names, calculating months employed, formatting salaries, calculating review dates, and indicating salaries with asterisks.

Uploaded by

Aaiza Nadeem
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
You are on page 1/ 5

Task 14

Display the employee name, salary of all employees whose condition of salary is entered by user. Sort
the data in descending order according to the salary.

LAB#5
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:


<Employee name> earns <salary>monthly but wants <3 times salary>. Label the
column Dream Salaries.
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.2

LAB #6

You might also like