Relational Algebra Exanples
Relational Algebra Exanples
r(book) r(pub)
book id book title month year editor pub id title book id
1 CACM April 1960 8 1 LISP 1
2 CACM July 1974 8 2 Unix 2
3 BST July 1948 2 3 Info Theory 3
4 LMS November 1936 7 4 Turing Machines 4
5 Mind October 1950 NULL 5 Turing Test 5
6 AMS Month 1941 NULL 6 Lambda Calculus 6
7 AAAI July 2012 9
8 NIPS July 2012 9
Solution: 2
3. Write a relational algebra expression that returns the names of all authors who are book editors.
Page 2
4. Write a relational algebra expression that returns the names of all authors who are not book editors.
5. Write a relational algebra expression that returns the names of all authors who have at least one publi-
cation in the database.
6. How many tuples are returned by the following relational algebra expression?
Solution: 11
Page 3