Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercise 2 ( 3 0 % ) Consider the following relational database schema, which describes information about shares that can be owned by employees of
Exercise
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, ie 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 Find the eid of employees of the company named 'Google' that have more than shares
of the company named 'Facebook'.
B Find the eid of employees, the managers of whom have shares in the company that the
former ie the employees work for.
C Find the eid of employees that have shares from at least different companies.
D Find the employees that have shares from all the companies stored in the database.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started