You are a database professor making questions for the students. You should provide…
- User
You are a database professor making questions for the students. You should provide answer in LaTex format. Give the step by step reasoning for giving to that conclusion
Consider the following schema of a Company database: Employees(eid: integer, ename: string, address: string, supereid: integer, salary: integer) Departments(did: integer, dname: string) Projects(pid: integer, pname: string, did: integer, budget: integer) Works_on(eid: integer, pid: integer, hours: integer) Primary keys are underlined. Each Employee has a supervisor (another Employee) referenced by their supereid. Projects are uniquely assigned to a Department. The Works_on relation records which Employee works on which Project for how many hours a week. The primary key of a relation consists of all its underlined attributes. There are foreign key constraints between Employees.supereid and Employees.eid, between Works_on.eid and Employees.eid, between Works_on.pid and Projects.pid and between Projects.did and Departments.did. For assignments 1.1 to 1.7, formulate the natural language question as relational algebra (RA) query or explain why the query cannot be formulated in RA. You must use the exact notation for the RA operations introduced in class. In particular, you cannot use dot notation to refer to attributes but must rename attributes, where necessary. Assignment 1.1 (10 marks) For the “IT” Department, return the pname of those projects of that Department for which at least one Employee works. Assignment 1.2 (10 marks) For each Employee, return their ename and the ename of their supervisees (the Employees directly supervised by that Employee). Assignment 1.3 (10 marks) For each Employee, return their ename and the ename of the Employees directly or indirectly supervised by that Employee. Assignment 1.4 (15 marks) Return the eids of Employees who do not work on every Project. Assignment 1.5 (15 marks) Assignment 1.6 (15 marks) Return the eid of the Employees who are working for the maximum number of Departments. Return the pid of the Projects that have the minimum budget. Assignment 1.7 (15 marks) Return the pids of the Projects for which at least two different Employees are working. Assignment 1.8 (10 marks) Union and Set Difference are among the five basic RA operations, but Intersection is not. Show how to implement Intersection using Union and Set Difference.
- Assistant