COMP 2605 Lab 2 Tutorial
COMP 2605 Lab 2 Tutorial
St. Augustine
Department of Computing and Information Technology
COMP 2605– Enterprise Database Systems
ORACLE LAB # 2
1. Run the script lab2script.sql to create and populate your versions of the myEmployee
and myDepartment tables.
3. (a) Display all the data from the myEmployee table by listing all the column names.
4. Display the employee name and hire date of all employees. Name consists of the first
and last name.
7. (a) Display the employee name, job title and annual salary of each employee.
(b) Display the same data in the previous table, this time labeling the columns as
“Name”, “Job title” and “Annual Salary” respectively.
9. (a) Display the employee name and title of all employees whose monthly salary lies in
the range $2,500 to $5,000.
10. Display the name and job title of all employees without a manager.
11. Display the names of all employees who report to managers 7698 and 7839.
Page 1 of 2
You are required to perform this query using two methods:
a) Using the in operator
b) Using logical and comparison operators.
12. Display the names of all salespersons that were hired on or before 1st March 1981.
14. Display the name, title and hire date of all employees in ascending order by title and
descending order by hire date within the title ordering.
15. Display each employee name with a count of the number of characters in the name. Use
length function.
16. Display the first letter of each employee’s name. Use substr function.
17. Display job data for all employees in the following format:
19. Display the name, job title and manager of all employees. Your query should return the
value ‘No Manager’ for those employees without a manager.
20. Display the name, job title, annual salary and annual bonus for all employees, where
bonus is calculated as follows:
Page 2 of 2