Sid and Pid Together Form The Key For Catalog. The Catalog Relation Lists The
Sid and Pid Together Form The Key For Catalog. The Catalog Relation Lists The
Sid and Pid Together Form The Key For Catalog. The Catalog Relation Lists The
The key fields are underlined, and the domain of each field is listed after the
field name. Therefore sid is the key for Suppliers, pid is the key for Parts, and
sid and pid together form the key for Catalog. The Catalog relation lists the
prices charged for parts by Suppliers. Write the following queries in
relational algebra and SQL.
Q2 With respect to the above given schema-What does the following queries
compute?
1. πsname(πsid((σcolor=’red’Parts) (σcost<100Catalog))
Suppliers)
2. πsname(πsid((σcolor=’red’Parts) (σcost<100Catalog)
Suppliers))
Note that the Employees relation describes pilots and other kinds of employees as
well;every pilot is certified for some aircraft (otherwise, he or she would not
qualify as apilot), and only pilots are certified to fly.
Write the following queries in SQL
Q4. Consider the following relational schema. An employee can work in more than
one department; the pct_time filed of the Works relation shows the percentage of
time that a given employee works in a given department.
a. Print the names and ages of each employee who works in both the Hardware
department and the Software department.
b. Print the name of each employee whose salary exceeds the budget of all of the
departments that he or she works in.
c. Find the managerids of managers who manage only departments with budgets
greater than $1 million.
Q5
A recording studio needs help designing its database. The studio stores information
about musicians and albums. Draw an ER diagram describing the studio’s database
for the scenario described as:
a) Each musician who records at the studio has a social security number (ssn)
and a name, and no two musicians have the same ssn. Musicians form bands.
A band is described by a unique name and has at least one musician as a
member.
b) Bands record albums, which have a title and a year of production. Each
album is recorded by exactly one band, and no two albums have the same
title and the same production year. Each album is produced by exactly one
musician. (So not to consider here that musician is a member of the
recording band.)
c) Albums are made up of songs, described by their titles. You may assume
that, if the studio no longer wants to store information about an album, then
it also does not store the songs belonging to that album. Naturally, each song
belongs to exactly one album, and all songs on the same album have
different titles
Submission instructions