Question: USE RELATIONAL ALGEBRA! I WILL THUMBS UP ! Consider the following schema of a Company database: Assignment 1 . 5 ( 1 5 marks )

USE RELATIONAL ALGEBRA! I WILL THUMBS UP! Consider the following schema of a Company database: Assignment 1.5(15 marks)
Return the eid of the Employees who are working for the maximum number of Departments.
Assignment 1.6(15 marks)
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.
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.
USE RELATIONAL ALGEBRA! I WILL THUMBS UP !

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 Programming Questions!