Question: Based on the relational schema below: Emp(eid: integer, ename: string, age: integer, salary: real) Works(eid: integer, did: integer, pcttime: integer) eptdteg er imegen Express the

 Based on the relational schema below: Emp(eid: integer, ename: string, age:

integer, salary: real) Works(eid: integer, did: integer, pcttime: integer) eptdteg er imegen

Based on the relational schema below: Emp(eid: integer, ename: string, age: integer, salary: real) Works(eid: integer, did: integer, pcttime: integer) eptdteg er imegen Express the following queries in Relational Algebra. Please make use of the relational algebra operators that was introduced in class (including aggregation and grouping operators). If you believe you cannot express a given query in relational algebra, explain why not. Or if you end up making some additional assumptions in order to express the queries clearly using relational algebra, please state your assumptions a. Find the names and ages of each employee who works in both the Sales epartment and the Engineering department (assume that Sales Dept ID -101 and Engineering Dept ID- 102) Find the mamagerids of managers who manage only departments with budgets greater than $2,000,000. (Please note that if a manager manages Dept 1 and Dept 2, while Dept 1 has a budget of 1,000,000 and Dept 2 has a budget of 5,000,000, then this manager would not be included in the result list.) b. For each department with more than 18 full-time-equivalent employees, i.e., the part-time and full-time employees add up to at least that many full-time employees), find the did together with the number of employees which work in that department. c. For this question, please note that there is an attribute pettime (of Integer type) in the Works table, as the schema shows. A tuple/row in the Works Table indicates that the Employee 0002 works in Department 102 with 80% of time, which is also PART TIME. Finally, a tuple/row in the Works Table indicates that the Employee 0003 works in Department 101 with 100% of time, which is FULL TIME. The number of FULL-TIME EQUIVALENT employees within a department is calculated based on the TOTAL PCTTIME of ALL employees in the department. As noted in the question (c), a department with eighteen full-time employees and five 50% part-time employees is considered as having 18*100%+5*50%-20.5 FULL-TIME EQUIVALENT employees, and thus should be included in the result with 23 (i.e., 18+5) as the ACTUAL number of employees in the department d. Find the name, age and salary of the youngest employee in each department. Find the department(s) with the lowest average salary of employees. e. Based on the relational schema below: Emp(eid: integer, ename: string, age: integer, salary: real) Works(eid: integer, did: integer, pcttime: integer) eptdteg er imegen Express the following queries in Relational Algebra. Please make use of the relational algebra operators that was introduced in class (including aggregation and grouping operators). If you believe you cannot express a given query in relational algebra, explain why not. Or if you end up making some additional assumptions in order to express the queries clearly using relational algebra, please state your assumptions a. Find the names and ages of each employee who works in both the Sales epartment and the Engineering department (assume that Sales Dept ID -101 and Engineering Dept ID- 102) Find the mamagerids of managers who manage only departments with budgets greater than $2,000,000. (Please note that if a manager manages Dept 1 and Dept 2, while Dept 1 has a budget of 1,000,000 and Dept 2 has a budget of 5,000,000, then this manager would not be included in the result list.) b. For each department with more than 18 full-time-equivalent employees, i.e., the part-time and full-time employees add up to at least that many full-time employees), find the did together with the number of employees which work in that department. c. For this question, please note that there is an attribute pettime (of Integer type) in the Works table, as the schema shows. A tuple/row in the Works Table indicates that the Employee 0002 works in Department 102 with 80% of time, which is also PART TIME. Finally, a tuple/row in the Works Table indicates that the Employee 0003 works in Department 101 with 100% of time, which is FULL TIME. The number of FULL-TIME EQUIVALENT employees within a department is calculated based on the TOTAL PCTTIME of ALL employees in the department. As noted in the question (c), a department with eighteen full-time employees and five 50% part-time employees is considered as having 18*100%+5*50%-20.5 FULL-TIME EQUIVALENT employees, and thus should be included in the result with 23 (i.e., 18+5) as the ACTUAL number of employees in the department d. Find the name, age and salary of the youngest employee in each department. Find the department(s) with the lowest average salary of employees. e

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!