Data Base and Management System Lab
Data Base and Management System Lab
CSL-220
Lab journal 6
1. Write a query to retrieve ename, length of enames, loc,deptno and sal by join table EMP
with table DEPT where deptno is 30 and sal is greater than 800. Sort the sal in descending
order.
2 Write a query to combine all rows of table EMP and table DEPT. Sort the columns in ascending
order by employee names.
3 Write a query for table EMP and DEPT to retrieve enames ,sal, job, deptno, loc where length of
job is greater than length of loc.
4 Write a query to join table EMP with itself wheremgr exists for any employee.
5 Create a query that displays ename, deptno, and all enames of those employees who
work in the same department as a given employee. Give each column an appropriate Label.
6 Create a query that displays enames, deptno, and hiredates of all employees hired after
employee MARTIN.
7 Create a query that displays enames, deptno, and hiredates for all employees who were
hired before their managers, along with their manager’s names and hiredates. Give the
columns with appropriate labels.
8 Write a query to display the name, department number, and department name for all
employees.
9 Create a unique listing of all jobs that are in department 80. Include the location of the
department in the output
10 Write a query to display the name, job, department number, and department name
11 Display the employee name and employee number along with their manager’s name
and manager number. Label the columns Employee, Emp#, Manager, and Mgr#, respectively.
12 Display all employees including King, who has no manager.
13 Create a query to display the name and hire date of any employee hired after employee
Davies.
14 Display the names and hire dates for all employees who were hired before their
managers, along with their manager’s names and hire dates
15 Show the structure of the JOB_GRADES table. Create a query that displays the name,
job, department name, salary, and grade for all employees.