Anda di halaman 1dari 1

1. Consider the following schema for a library database.

Author(authorname, citizenship, birthyear)


Book(isbn, title, authorname)
Topic(isbn, subject)
Branch(libname, city)
Instock(isbn, libname, quantity)
Write the relational algebra expressions for the following.
a. Give the name of all authors born after 1940
authoname(birthyear>1940(Author))
b. Give the name of all the libraries is Sydney
libname(city=Sydney(Branch))
c. Give the cities where each book is held
city(Book Branch)

2. Consider the following schema


Employee(person name, street, city)
Works(person name, company name, salary)
Company(company name, city)
Manager(person name, manager name)
a. Find the name of all employees who work for the First Bank Corporation
person_name(company_name=First Bank Corporation(Works))
b. Find the name and cities of residence of all the employees who work for
the First Bank Corporation
person_name, city (Employee (company_name=First Bank Corporation (Works)))
c. Find the name, street and cities of residence of all employees who works
for First Bank Corporation and earn more than USD 10,000 per annum.
person_name, street, city (company_name=First Bank Corporation salary > 10000 (Works Employee))
d. Find the names of all employees in this database who live in the same city
as the company for which they work.
person_name(Employee Works Company)

e. Find the names of all employees in this database who do not work for First
Bank Corporation.
person_name((Works) - company_name=First Bank Corporation(Works))

Anda mungkin juga menyukai