0% found this document useful (0 votes)
48 views8 pages

Lab-1 and 2 Solution Qazi Mujtaba

This document contains the solutions to 12 lab exercises involving SQL queries on EMP and DEPT tables. The queries list employee and department data by name, number, salary, date and other fields. Calculations are performed to derive monthly, daily, and hourly salaries from annual salaries. Records are ordered and filtered in various ways such as by department number, job type, name pattern matching, and date ranges. Commissions are set to zero in one exercise.

Uploaded by

Qazi Mujtaba
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)
48 views8 pages

Lab-1 and 2 Solution Qazi Mujtaba

This document contains the solutions to 12 lab exercises involving SQL queries on EMP and DEPT tables. The queries list employee and department data by name, number, salary, date and other fields. Calculations are performed to derive monthly, daily, and hourly salaries from annual salaries. Records are ordered and filtered in various ways such as by department number, job type, name pattern matching, and date ranges. Commissions are set to zero in one exercise.

Uploaded by

Qazi Mujtaba
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/ 8

DATABASE MANAGEMENT SYSTEM

LAB # 01
Name: Qazi Mujtaba Enrollment: 01-235171-050
Section: BS (IT)-4 (B) Date: 22/102021

1. List all information of ‘Emp’ and ‘Dept’ tables.


Solution:

2. List the empno,ename,jobtitle,and hiredate of employee from the employee table.


Solution:
3. List the name,salary of the employees who are clerks.
Solution:

4. List the name,job,salary of every employee joined on ‘december 17,1980’,


Solution:

5. List name and annual salary of all the employees.


Solution:

6. List the department name & deptno for departments having deptno.>=20
Solution:
7. Display employees’ names, salary and manager values of those employees whose salary is 500
from EMP table using SELECT statement.
Solution:

8. Select dname from DEPT table where location is Islamabad.


Solution:

9. Increment the salary of each employee 10 times and then display the annual salary along with
emp#, employee names and dept# from EMP table.
Solution:

10. List the employees who have salary between 1000&2000.


Solution:

11. List the name,salary,commision of the employees where commision is greater than their salary.
Solution:
12. List the name and empno of managers who earn more than 2000.display the result in
alphabetical order of the name.
Solution:

13. List the details of the employees in the depts of 10 & 20 in the order of empno.
Solution:
DATABASE MANAGEMENT SYSTEM LAB
LAB # 02

1. List the name, monthly salary and daily salary and hourly salary for employee; assume that
there are 22 working days in a month,8 working hours in a day. Display the rows with column
names as monthly, daily &hourly sal.
Solution:

2. List the name and empno of managers who earn more than 2000.display the result in
alphabetical order of the name.
Solution:

3. Display all employee names which have ‘TH’or ‘LL’ in them.


Solution:
4. List the details of the employees in the depts of 10 & 20 in the order of empno.
Solution:

5. Display the information about the managers and clerks from the column ‘Job’ in the table
emp,order the result by deptno.
Solution:

6. List the empnames that don’t end with ‘s’.


Solution:
7. List the emp names that begin with ‘c’.
Solution:

8. List the names of the employees starts with T/t and ends with R/r.
Solution:

9. List the name of employees who joined during 1983.


Solution:

10. List the data as shown below


”Smith has held the position of clerk in dept 20 since 19 june,1983”
Solution:

11. List all rows in employee table by converting commission column to zero.
Solution:

You might also like