You are on page 1of 15

(

Name: Muhammad Ammar Enr #: 02-235171-018 Reg #: 48885


Course: Database Management System Class: BS(IT)-4A Lab 1 – Lab 4

DBMS Lab # 01
Task 1: Get empno, ename, sal, deptno from emp table.

Task 2: Count total number of employees.

Task 3: Get the highest and the lowest salary from emp table.
(
Name: Muhammad Ammar Enr #: 02-235171-018 Reg #: 48885
Course: Database Management System Class: BS(IT)-4A Lab 1 – Lab 4

Task 4: Calculate net salaries of employee (by adding salary and comm).

Task 5: Display all the deptno that employees belong to, but don’t allow repetition.

Task 6: Display data of all employees who work as Salesman.


(
Name: Muhammad Ammar Enr #: 02-235171-018 Reg #: 48885
Course: Database Management System Class: BS(IT)-4A Lab 1 – Lab 4

Task 7: Display names of employees who work in deptno 20.

Task 8: Calculate one year salary of every employee from emp table.
(
Name: Muhammad Ammar Enr #: 02-235171-018 Reg #: 48885
Course: Database Management System Class: BS(IT)-4A Lab 1 – Lab 4

Task 9: Display the total count of departments from dept table.

Task 10: Display the employee name whose salary is more than 2000 but less than 3500.
(
Name: Muhammad Ammar Enr #: 02-235171-018 Reg #: 48885
Course: Database Management System Class: BS(IT)-4A Lab 1 – Lab 4

Task 11: Display all employee names and their manager number from emp table.

Task 12: Show the average salary of all employees.

Task 13: Show the total salary of all employees.


(
Name: Muhammad Ammar Enr #: 02-235171-018 Reg #: 48885
Course: Database Management System Class: BS(IT)-4A Lab 1 – Lab 4

DBMS Lab # 2
Task # 1: Display empno,sal of employees whose sal is less than 2000.

Task # 2: List ename of all employees whose name starts with letter ‘A’.

Task # 3: Display ename,job,deptno of employees who are either SALESMAN or belongs to


deptno =10.
(
Name: Muhammad Ammar Enr #: 02-235171-018 Reg #: 48885
Course: Database Management System Class: BS(IT)-4A Lab 1 – Lab 4

Task # 4: Display ename,sal of employees whose salaries lies in the range of 1500 to 3000.

Task # 5: Display ename,comm of employees whose commission is empty.

Task # 6: Display names of all employees that end with alphabet ‘N’.
(
Name: Muhammad Ammar Enr #: 02-235171-018 Reg #: 48885
Course: Database Management System Class: BS(IT)-4A Lab 1 – Lab 4

Task # 7: Show ename,sal,job of those employees who are not ‘SALESMAN’.

Task # 8: Show empno,sal of those employees who do not have salaries of 1600, 1250, 3000.

Task # 9: Show names of those employees whose name starts with A and ends with N.
(
Name: Muhammad Ammar Enr #: 02-235171-018 Reg #: 48885
Course: Database Management System Class: BS(IT)-4A Lab 1 – Lab 4

Task # 10: Display the list of employee names that have letters ‘LA’ in their names.

Task # 11: Display the empno,sal of employees. In that, the highest paid employee should display
first and lowest paid should display last.
(
Name: Muhammad Ammar Enr #: 02-235171-018 Reg #: 48885
Course: Database Management System Class: BS(IT)-4A Lab 1 – Lab 4

DBMS Lab 3
Task 1: Display ename, job, sal of all the employees whose job is “CLERK”. Keeping this in mind
that CLERK may be in capital, small or combination of small capital characters in the table.

Task 2: Generate new names of the employees by combining the first 3 characters of the ename
and last 3 characters of the job.
(
Name: Muhammad Ammar Enr #: 02-235171-018 Reg #: 48885
Course: Database Management System Class: BS(IT)-4A Lab 1 – Lab 4

Task 3: Generate new jobs of the employees by changing letter E with A in the existing jobs.

Task 4: Display ename, total years in the department.


(
Name: Muhammad Ammar Enr #: 02-235171-018 Reg #: 48885
Course: Database Management System Class: BS(IT)-4A Lab 1 – Lab 4

Task 5: Display ename, hiredate of all the employees who were hired before February 20,
1981.Keeping this in mind that hiredates should be displayed in the format “MONTH DATE,YEAR”.
Also date in the where clause should be in the format “MONTH DATE, YEAR”.

Task 6: Display employee name,sal,comm and total salary (Comm + Sal) of all the employees.
Keeping this in mind that comm of some of the employee might be null but total salary of the
employees should not be null.

Task 7: Display employee name,sal,comm and total salary (Comm + Sal) of all the employees.
Keeping this in mind that comm or sal of some of the employee might be null but total salary
of the employees should not be null.In case of comm is null, total salary should be the
original salary or if the salary is null, total salary should be the original comm.
(
Name: Muhammad Ammar Enr #: 02-235171-018 Reg #: 48885
Course: Database Management System Class: BS(IT)-4A Lab 1 – Lab 4

Task 8: Display ename,sal,comm and bonus of all the employees. If job = CLERK then bonus=20%
of the salary, if job = SALESMAN then bonus = 30% of the salary, if job = MANAGER then bonus =
50% of the salary else bonus = 10% of the salary.
(
Name: Muhammad Ammar Enr #: 02-235171-018 Reg #: 48885
Course: Database Management System Class: BS(IT)-4A Lab 1 – Lab 4

DBMS LAB 04
Task 1: Display the deptno and average salary of those departments whose average salary is
greater than 2500.

Task 2: Display the ename, sal, deptno and average salary of the department of those employees
who earn more than the average salary of their own departments.

Task 3: Display the total number of employees who have no commission.


(
Name: Muhammad Ammar Enr #: 02-235171-018 Reg #: 48885
Course: Database Management System Class: BS(IT)-4A Lab 1 – Lab 4

Task 4: Write a query to display the number of employees with the same job.

Task 5: Display department no wise, job wise total salaries of those departments having total
salary greater than 5000 but deptno should not be 10 and job should not be ‘CLERK’.

You might also like