Question: Exercise 2 ( 3 0 % ) Consider the following relational database schema, which describes information about shares that can be owned by employees of

Exercise 2(30%)
Consider the following relational database schema, which describes information about shares that can
be owned by employees of companies. Specifically, the database schema consists of: (a) the relational
schema Employee, in which the attribute cid is a foreign key to the relational schema Company, and
the managerid, which is a foreign key in the same schema, i.e. Employees; eid is the primary key of
Employees (b) the relational schema Company that holds information about companies, in which the
primary key is cid, and (c) the relational schema Shares that stores information about employees that
have shares of companies, as well as the number of these shares, sharenum; eid in Shares is a foreign
key to Employees, and cid in Shares is a foreign key to Company.
Employee (eid, cid, salary, managerid)
Company (cid, companyname, location)
Shares (eid, cid, sharenum)
Express in relational algebra the following queries:
A.(6%) Find the eid of employees of the company named 'Google' that have more than 500 shares
of the company named 'Facebook'.
B.(6%) Find the eid of employees, the managers of whom have shares in the company that the
former (i.e. the employees) work for.
C.(9%) Find the eid of employees that have shares from at least 3 different companies.
D.(9%) Find the employees that have shares from all the companies stored in the database.
 Exercise 2(30%) Consider the following relational database schema, which describes information

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!