Assignment 02 (1)
Assignment 02 (1)
Write the following queries in relational algebra, using the university schema.
a. Find the titles of courses in the Comp. Sci. department that have 3 credits.
b. Find the IDs of all students who were taught by an instructor named Einstein; make sure
there are no duplicates in the result.
d. Find all instructors earning the highest salary (there may be more than one with the same
salary).
e. Find the enrollment of each section that was offered in Autumn 2009.
g. Find the sections that had the maximum enrollment in Autumn 2009.
Consider the relational database of Figure 6.22 in text book, where the primary keys are
underlined. Give an expression in the relational algebra to express each of the following
queries:
a. Find the names of all employees who live in the same city and on the same street as do
their managers.
b. Find the names of all employees in this database who do not work for “First Bank
Corporation”.
c. Find the names of all employees who earn more than every employee of “Small Bank
Corporation”.
e. Find all cities of residence of all employees who work directly for “Jones.”
g. Find those employees who earn more than all employees living in the city “Mumbai.”