LAB ASSSIGNMENT 2 for dbms
LAB ASSSIGNMENT 2 for dbms
1. Consider the following relational schema. An employee can work in more than one
department; the pct_time filed of the Works relation shows the percentage of time that a given
employee works in a given department.
a. Print the names and ages of each employee who works in both the Hardware department
and the Software department.
b. For each department with more than 20 full-time-equivalent employees (i.e., where the
part-time and full-time employees add up to at least that many full-time employees), print
the did together with the number of employees that work in that department.
c. Print the name of each employee whose salary exceeds the budget of all of thedepartments
that he or she works in.
d. Find the managerids of managers who manage only departments with budgetsgreater than
$1 million.
e. Find the enames of managers who manage the departments with the largestbudgets.
f. If a manager manages more than one department, he or she controls the sum of all the
budgets for those departments. Find the managerids of managers who control more than $5
million.
g. Find the managerids of managers who control the largest amounts.
h. Find the enames of managers who manage only departments with budgets larger than $1
million, but at least one department with budget less than $5million.
2. a. Create a relational database that contains the following tables and insert the following data
into these tables
STUD_MEMBER
Dept_ID Dept_Name
1 Information Technology
2 Electrical
3 Civil
4 Mechanical
5 Chemical