Answered step by step
Verified Expert Solution
Link Copied!

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 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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago